フィルターのクリア

why do i get the error: matrix dimensions must agree ??

2 ビュー (過去 30 日間)
María Jesús
María Jesús 2014 年 9 月 29 日
編集済み: Mischa Kim 2014 年 9 月 29 日
this is what I'm trying to plot
x=linspace(0,100,100);
a=5;
y=1/(abs(a*x)+1);
figure
plot(x,y)
how do I fix this error?

採用された回答

Mischa Kim
Mischa Kim 2014 年 9 月 29 日
編集済み: Mischa Kim 2014 年 9 月 29 日
Maria, use
y = 1./(abs(a*x) + 1);
instead. Notice the dot right after the "1". This so-called elementwise division is necessary because x is a vector. See the documentation for more detail.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by