Questions regarding plots and displays

2 次查看(过去 30 天)
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?

采纳的回答

Star Strider
Star Strider 2016-12-29
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 个评论
Ricardo Boza Villar
Ricardo Boza Villar 2016-12-29
编辑:Ricardo Boza Villar 2016-12-29
Problems solved, thank you very much for your answer! I run my code in version 2015b and it works. I attach the code with the patches.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Printing and Saving 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by