TransWikia.com

How do I plot data in Octave?

Data Science Asked by MrPythonic on May 14, 2021

I wanted to plot a data in Octave for a logistic regression problem my teacher in my university assigned me to solve.
Let’s say the input-training features is a matrix X and output is y=1 or y=0
To plot the data I made this statement:

pos = find(y==1);neg = find(y==0);

plot(X(pos,1),X(pos,2),’k+’,’LineWidth’,2,’MarkerSize’,7);

plot(X(neg,1),X(neg,2),’ko’,’MarkerFaceColor’,y,’MarkerSize’,7);

But it does not compile and it shows the single quotes as unidentified characters.
Please help…

One Answer

I am not an Octave expert, but it seems that you answered your own question. The quotation marks that you posted in your question are indeed not "regular" quotation marks.

Fix these characters and your code should run smoothly.

Also, maybe I am being pedantic, but since Octave is an interpreted language, it doesn't technically "compile" anything.

Answered by Valentin Calomme on May 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP