-1
$\begingroup$

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...

$\endgroup$
0
$\begingroup$

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.

$\endgroup$
5
  • $\begingroup$ Thank you for your opinion.But I did not understand what you meant by "fix".Did you mean use double quotes instead? $\endgroup$ – MrPythonic Jun 2 '20 at 8:56
  • $\begingroup$ Yes, replace it. Right now, the character you used as a quotation mark IS NOT a quotation mark. It just looks like it. $\endgroup$ – Valentin Calomme Jun 2 '20 at 9:33
  • $\begingroup$ Hmm it still does not work.By the way I use ms word to code the program as a function PlotData(X,y) and later call it in Octave command prompt,I hope this gives you a hint to help me. $\endgroup$ – MrPythonic Jun 2 '20 at 11:53
  • $\begingroup$ If you want to help, then you should post the actual error message that you receive. And you should make your code in a way that I can run it as well. At this point, I have no way to run your code as y is an unknown variable. $\endgroup$ – Valentin Calomme Jun 2 '20 at 13:41
  • $\begingroup$ @MrPythonic if you don't have a regular quotation mark on your keyboard, you can just copy-paste it. You can choose between ' and " :) $\endgroup$ – Avi Nov 16 '20 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.