当前位置:网站首页>Matlab experience summary

Matlab experience summary

2022-07-07 15:38:00 sgmcy

1、 Create a new one under a directory plot.m file

Then the working directory of my command line terminal coincides with this plot.m The directory is under the same directory

Then I'm at the command line terminal knock plot() Command drawing , The following error occurred :

matlab Report errors : Try to SCRIPT plot Execute as a function

Later on plot.m Modified into my_plot.m Solved the problem

2、 Due to the previous installation MATLAB When , do not know why , Installed in Chinese

As a result, I'm using it notepad++ To write .m When you file , There are a lot of garbled codes

The fact proved that ,MATLAB The support for Chinese is not very friendly , therefore , It is better to annotate in English

3、plot When drawing , Use xlabel ,ylabel as well as title Set the annotation

At that time, Chinese was used , The picture that was drawn , Not shown in the figure xlabel ,ylabel as well as title

Due to the second point, the comments are garbled

Switch to English

But I found that there was still no xlabel ,ylabel as well as title

Finally found , my xlabel ,ylabel as well as title Double quotation marks are used inside , After switching to single quotation marks , The problem is solved

4、 When it comes to testing , Find out xlabel ,ylabel as well as title It doesn't print out every time , Sometimes it can be printed , Sometimes it doesn't print out , Most of the time, it can't be printed . It turned out ,xlabel ,ylabel as well as title It must be placed in plot Behind

figure(5);

xlabel('time ');
ylabel('Power ');
title('yuanyu :  ');

plot(yy_closeyes1_delta);
hold on;
plot(yy_closeyes1_delta);

stay plot Before , In this way, the title cannot be drawn
 

figure(5);
plot(yy_closeyes1_delta);
hold on;
plot(yy_closeyes1_delta);

xlabel('time ');
ylabel('Power ');
title('yuanyu : ');

Change to in plot after , You can draw .

原网站

版权声明
本文为[sgmcy]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130612547727.html