MATLAB Answers

Plotting help

2 views (last 30 days)
Alex on 28 Sep 2011
Hi, I'm pretty new to Matlab, and I tried to execute this script:
eq1 = '((((1.5-(x-(i*(y))))/(1.5+(x-(i*(y)))))+((((x-(i*y))-((3.46163-(i*(0)))))/((x-(i*(y)))+(3.46163-(i*(0)))))*(exp(-2*i*((pi*2)/1796)*(x-(i*(y)))*z))))/(1+(((1.5-(x-(i*(y))))/(1.5+(x-(i*(y)))))*(((x-(i*(y)))-(3.46163-(i*(0))))/((x-(i*(y)))+(3.46163-(i*(0)))))*(exp(-2*i*((pi*2)/1796)*(x-(i*(y)))*z)))))-.30441';
eq2 = '((((1.5-(x-(i*(y))))/(1.5+(x-(i*(y)))))+((((x-(i*y))-((3.46153-(i*(0)))))/((x-(i*(y)))+(3.46153-(i*(0)))))*(exp(-2*i*((pi*2)/1798)*(x-(i*(y)))*z))))/(1+(((1.5-(x-(i*(y))))/(1.5+(x-(i*(y)))))*(((x-(i*(y)))-(3.46153-(i*(0))))/((x-(i*(y)))+(3.46153-(i*(0)))))*(exp(-2*i*((pi*2)/1798)*(x-(i*(y)))*z)))))-.30440';
eq3 = '((((1.5-(x-(i*(y))))/(1.5+(x-(i*(y)))))+((((x-(i*y))-((3.46143-(i*(0)))))/((x-(i*(y)))+(3.46143-(i*(0)))))*(exp(-2*i*((pi*2)/1800)*(x-(i*(y)))*z))))/(1+(((1.5-(x-(i*(y))))/(1.5+(x-(i*(y)))))*(((x-(i*(y)))-(3.46143-(i*(0))))/((x-(i*(y)))+(3.46143-(i*(0)))))*(exp(-2*i*((pi*2)/1800)*(x-(i*(y)))*z)))))-.30439';
ezplot(eq1), hold on;
ezplot(eq2), hold on;
ezplot(eq3), hold off;
but it didn't work (some of you want to sternly tell me off right now, I know). Here is the error message:
??? Error using ==> char
Cell elements must be character arrays.
Error in ==> ezplot at 158
fmsg = char(f);
Error in ==> nonlintest2 at 4
ezplot(eq1), hold on;
Error in ==> run at 74
evalin('caller',[script ';']);
So, as a new user, I don't know how to use this error report very well, and looking online has gotten me some approximate info, but nothing that truly explains my situation to me. Can anyone help me with this please? I'd love to learn how to make this work.
Fangjun Jiang
Fangjun Jiang on 28 Sep 2011
@cyclist, to use ezplot()

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 28 Sep 2011
It is a bug in ezplot in constructing the error message to tell you that ezplot cannot be used to plot equations in more than 2 variables.
Alex on 3 Oct 2011
Yeah, that's the difficulty that I'm having with this. I don't know a lot about the language of Matlab, nor it's graphing capabilities, hence the post. If I had the optimization toolbox I could try using fsolve, but I don't, which leaves me in a pickle.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!