simple x.y plot
์ด์ ๋๊ธ ํ์
%Q2) Create a variable ๐ฅ which is a vector containing multiples of 5 between
% 0 and 50.
x = (0:5:50)
% Compute the function ๐ฆ and plot it against ๐ฅ using red colour dash line
% with circle markers:
y = (4*(x^2)*log(6))+(5*(x^2)) / sqrt (cos(x).^2) +1
plot (x,y, r--o)
๋๊ธ ์: 1
Markers inside the plot function are accessed using strtings/chars
%Q2) Create a variable ๐ฅ which is a vector containing multiples of 5 between
% 0 and 50.
x = (0:5:50);
% Compute the function ๐ฆ and plot it against ๐ฅ using red colour dash line
% with circle markers:
y = ((4*(x.^2)*log(6))+(5*(x.^2))) ./ (sqrt (cos(x).^2)+1 );
plot (x,y, '--ro') % remember markers are accessed using strings/chars
Matlab intreprets any text placed outisde the chars/strings as variables of other data types and expects input values to those variables.
help plot
๋ต๋ณ (1๊ฐ)
Torsten
2024๋
3์ 5์ผ
Use
y = (4*(x.^2)*log(6))+(5*(x.^2)) ./ sqrt (cos(x).^2) +1
instead of
y = (4*(x^2)*log(6))+(5*(x^2)) / sqrt (cos(x).^2) +1
๋๊ธ ์: 2
Newer users tend to encounter this type of problem frequently as they start learning MATLAB. A couple releases ago (after 20 years I can't always remember offhand when we made certain changes :) I believe we enhanced the error message to try to provide more information about how to solve the problem.
%Q2) Create a variable ๐ฅ which is a vector containing multiples of 5 between
% 0 and 50.
x = (0:5:50)
% Compute the function ๐ฆ and plot it against ๐ฅ using red colour dash line
% with circle markers:
y = (4*(x^2)*log(6))+(5*(x^2)) / sqrt (cos(x).^2) +1
Is there any information you think could be added to this message or a way to rephrase some or all of it that would help users (especially newer users) to more effectively understand the problem and correct it themselves, without having to reach out to Answers or other MATLAB experts in their vicinity?
Torsten
2024๋
3์ 6์ผ
Is there any information you think could be added to this message or a way to rephrase some or all of it that would help users (especially newer users) to more effectively understand the problem and correct it themselves, without having to reach out to Answers or other MATLAB experts in their vicinity?
Maybe by including a link to a documentation page where Array vs. Matrix Operations are explained in examples ?
Like here:
?
์นดํ ๊ณ ๋ฆฌ
๋์๋ง ์ผํฐ ๋ฐ File Exchange์์ Graphics Performance์ ๋ํด ์์ธํ ์์๋ณด๊ธฐ
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
