フィルターのクリア

Matrix Dimensions must agree

1 回表示 (過去 30 日間)
Erik Sanabria
Erik Sanabria 2014 年 8 月 20 日
回答済み: Ben11 2014 年 8 月 20 日
Here is a simple function I have to plot for a course in Matlab:
x = [0:0.01:10];
gx = 1-(2/x.^2);
plot(x,gx);
axis([-1,12,-1,12])
When I run it I get this error message:
Error using / Matrix dimensions must agree.
Please help!

回答 (1 件)

Ben11
Ben11 2014 年 8 月 20 日
You're missing a "." in your division:
x = [0:0.01:10];
gx = 1-(2./x.^2);
plot(x,gx);
axis([-1,12,-1,12])

カテゴリ

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