Questions regarding plots and displays
1 view (last 30 days)
Show older comments
Ricardo Boza Villar
on 29 Dec 2016
Commented: Star Strider
on 29 Dec 2016
Hi. I've been working on this code that calculates the velocity field of the boundary layer that appears around an ellipsoid when there is a slow air flow around it. I attach the file, CLElipsoide.m. It's a function, but it doesn't need any input. The file is too long to post it here. I can't cut where the problem is because there are references to previous variables that wouldn't be taken into account. I think the best way to know the problem is to run the code.
Once you have run it, I'd like to ask two things:
Between lines 230 and 236 I have defined 9 of the 10 plots of figure 6. As a warning, I've used 'eval' in the process (I've heard this is very bad practice). Ok, why, if I've used semicolons to suppress the output, said outputs keep appearing in the workspace?
Between lines 256 and 267 I have defined the legend for figure 6. I've used 'sprintf'. I want a circumflex to appear over the letter X. (This might be related to LaTeX) How can I do it?
0 Comments
Accepted Answer
Star Strider
on 29 Dec 2016
For LaTeX help, see The Not So Short Introduction to LaTeX2ε (P.58 specifically). The command to put the hat on the ‘X’ is: '$\hat{X}$'.
I tried to run your function (that I copied and pasted to a file I test functions in), and got this error (the function in my test file begins at line 1805, so 2040 would be Line 236 in the code for ‘figure(6)’ in your original):
Attempt to add "q1" to a static workspace.
See Variables in Nested and Anonymous Functions.
Error in FunctionTest/CLElipsoide (line 2040)
eval(sprintf('%s=%s',vname1,vname2)); echo off
I’ll let you sort that.
I’m running R2016b, so version differences could account for my not being able to run your code. I doubt my test file is the problem. Functions have their own workspace, I’ve never had this problem with any other function, and no other functions are running in my test file.
2 Comments
More Answers (0)
See Also
Categories
Find more on Legend 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!