Hello people,
I am trying to plot a simple circle using this function
plot::Circle2d(4, [10, 10])
but I don't manage. The error I get is "Error: File: CIRCLE_1.m Line: 1 Column: 6 Unexpected MATLAB operator."
What I had in mind was to plot a circle from an equation such as x^2+y^2=16 but the only way I had found is this but I don't find it very nice way:
t = linspace(0,10*pi,100)'; D = [cos(t)-x1 -sin(t)-y1]; plot(D(:,1), D(:,2), 'Color','b', 'LineWidth',0.5)
Whenever I search for a circle in Matlab, it shows the above "plot::Circle2d" but I can't use it. I am new to this new version of Matlab. Am I missing something? Should I include some library? Thank you in advance people.

답변 (2개)

Sean de Wolski
Sean de Wolski 2013년 8월 2일

0 개 추천

This is a MuPAD command. You need to open a MuPAD notebook and then enter this command. This can be done by running the following at the MATLAB command prompt or by selecting the MuPAD Notebook App from the Apps gallery.
>>mupad

댓글 수: 2

Jan
Jan 2013년 8월 2일
[Relocated from the answer section]: Iliana wrote
Hello, thank you for your answers! that means that I can't incorporate it in my m-file? Well, I was looking for an easy way to plot a circle.
Sean de Wolski
Sean de Wolski 2013년 8월 2일
Not easily. I would recommend taking the approach that Jan did with the parametric equations.

댓글을 달려면 로그인하십시오.

Jan
Jan 2013년 8월 2일
편집: Jan 2013년 8월 2일

0 개 추천

"plot::Circle2d(4, [10, 10])" is a command for the symbolic toolbox, see http://www.mathworks.com/help/symbolic/mupad_ref/plot-circle2d.html . If you want to use MuPad, read the corresponding manuals, e.g. http://www.mathworks.com/help/symbolic/mupad_ug/first-steps-in-mupad.html.
For non-symbolic maths, the show Matlab code works and your opinion, that this is not "nice", is just a question of taste. I'd clean it up a little bit:
t = linspace(0, 2*pi, 200); % Not 10*pi
x = cos(t) - x1;
y = -sin(t) - y1;
plot(x, y, 'Color', 'b');
Please explain what "Whenever I search for a circle in Matlab" means explicitly, because the applied search method is obviously broken or biased. When I ask Google for "Matlab circle" I get a lot of useful examples. Even searching in this forum and the FileExchange lead to useful solutions.

댓글 수: 3

Jan
Jan 2013년 8월 2일
[Relocated from the answer section]: Iliana wrote
Dear Jan Simon, I mean that I type what I want in the search place and get these results. Additionally, there is no menu to search for toolboxes, and I find it a bit user unfriendly, I think the old versions where more straightforward.
Jan
Jan 2013년 8월 2일
I'm not sure what "the search place" is. There have been several people in this forum, who prefer the former help system also.
aredhel_vlsi
aredhel_vlsi 2013년 8월 5일
Thank you for your answer ! I made it, my mind had stopped working...Thank you

댓글을 달려면 로그인하십시오.

질문:

2013년 8월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by