フィルターのクリア

How to plot a circle with radius and coordinates?

2 ビュー (過去 30 日間)
Manu Manu
Manu Manu 2014 年 3 月 15 日
コメント済み: Azzi Abdelmalek 2014 年 3 月 16 日
Hey guys.. I'm new in Matlab and this is my first week of using it, and our teacher already gave us homeworks. He didn't show us anything, just something about matrix.
Please, how can I plot center(5,7) and radius 3? I've tried this:
function circleplot(xc, yc, r)
t = 0 : .1 : 2*pi;
x = r * cos(t) + xc;
y = r * sin(t) + yc;
plot(x, y)
axis square; grid
and called it like this:
xc = 5;
yc = 7;
r = 3;
circleplot(xc, yc, r)
Gives me error: | Undefined function 'circleplot' for input arguments of type 'double'. |

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 3 月 15 日
Your code is correct, check if your function is saved in the current folder
  4 件のコメント
Manu Manu
Manu Manu 2014 年 3 月 16 日
Man I forgot that my teacher wanted a SCRIPT to make this. What is the code for script?
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 3 月 16 日
The same without
function circleplot(xc, yc, r)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by