3D plot. Invalid expression. Why?
1 view (last 30 days)
Show older comments
Zaid Assaf
on 4 May 2020
Commented: Walter Roberson
on 4 May 2020
I am trying to plot a simple function but I get error:
Z = -25.6+ ((1/(1+10^(7.6-X.)))*(-24.6+Y.));
↑
Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched
delimiters.
Code:
x=(5:0.1:10);
y=(0:1:50);
[X,Y]=meshgrid (x,y);
Z = -25.6+ ((1/(1+10^(7.6-X.)))*(-24.6+Y.));
When I try other functions it works but not this one.
0 Comments
Accepted Answer
Walter Roberson
on 4 May 2020
Edited: Walter Roberson
on 4 May 2020
Z = -25.6+ ((1./(1+10.^(7.6-X))).*(-24.6+Y));
in particular no periods after X and Y
2 Comments
Walter Roberson
on 4 May 2020
there is no / or \ operator in the code I posted.
You might not have noticed that I also changed the / to ./ and ^ to .^
More Answers (0)
See Also
Categories
Find more on Antennas, Microphones, and Sonar Transducers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!