Attempt to execute script plot as a function?

Source: Internet
Author: User

Just compiled a simple drawingProgram,CodeAs follows:

Close all;
CLC;
Clear;
% SiNx
X = linspace (200 * Pi );
F1 = sin (X );
Plot (x, F1 );

Title ('plot of F_1 = sin (x )');
Xlabel ('x ');
Ylabel ('f _ 1 ');
Axis ([0 2 * pi-1.1 1.1]);

% Cos (X)
F2 = cos (X );
Figure;
Plot (x, F2 );
Title ('plot of F_2 = cos (x )');
Xlabel ('x ');
Ylabel ('f _ 2 ');
Axis ([0 2 * pi-1.1 1.1]);

% Plot on the same pic
Figure;
Plot (x, F1, '-go ')
Hold on;
Plot (x, F2, '-R ^ ');
Title ('plots of F_1 = sin (x), F_2 = cos (x )');
Xlabel ('x ');
Ylabel ('f _ 1, F_2 ');
Axis ([0 2 * pi-1.1 1.1]);

Legend ('f _ 1', 'f _ 2 ');

Gtext ('f _ 1 = F_2 at two places ');

As a result, I saved it as the plot. M file. After the execution, it always appears ?? Attempt to execute script plot as a function prompt, the result is carefully searched for the reason that the file name is incorrect to plot2d or any other can be changed, cannot be named using the built-in function name of Matlab.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.