フィルターのクリア

Empty sym: 0-by-1

3 ビュー (過去 30 日間)
Amory Tillinghast-Raby
Amory Tillinghast-Raby 2020 年 1 月 4 日
コメント済み: Walter Roberson 2020 年 1 月 4 日
I am really really new to matlab and essentially just playing around with it. However, I have come across an issue that I am not fully sure how to resolve.
My code is incredibly simple:
syms R
X = 3;
h1 = .5 - [.25 - (1/4*(R^2))*((R^2)-.0625)]^(1/2) == 5;
solve(h1,R)
However, when I try to solve h1 when it equals any value other than zero, I get the error - Empty sym: 0-by-1. Can anyone explain to me why this is happening?

回答 (1 件)

Marco Riani
Marco Riani 2020 年 1 月 4 日
First of all it is necessary to replace [ ] with ( ) in your equation.
h1= .5 - (.25 - (1/4*(R^2))*((R^2)-.0625))^(1/2) == 5;
solve(h1,R)
Finally, If you try to plot your equation
x=-200:0.1:200;
y=.5 - (.25 - (1/4*(x.^2)).*((x.^2)-.0625)).^(1/2) -5;
plot(x,y)
you can see that y is never 0
Hope it helps
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 1 月 4 日
It is not necessary to replace the [] with (), but the code is more efficient if you do use ()

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

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by