how to use the 'user defined' type in the window designer app?

4 ビュー (過去 30 日間)
Palguna Gopireddy
Palguna Gopireddy 2022 年 2 月 24 日
コメント済み: Palguna Gopireddy 2022 年 3 月 10 日
I am trying to use window designer app, and I am unable to use the 'user defined' type in the 'Type' tab of the 'current window information' panel. I selected 'user defined' type and written sqrt(length^2-n.^2) and it is giving error 'not enough input arguments. I tried defining n==[-(length-1)/2:(lebgth-1)/2]; sqrt(length^2-n.^2); it is giving invalid expression.
I don;t know how to resolve this.

採用された回答

Cris LaPierre
Cris LaPierre 2022 年 2 月 24 日
編集済み: Cris LaPierre 2022 年 2 月 24 日
The error you are seeing is specifically in relation to length. It is trying to use the length function, but it needs an input.
% with an input
length(1:10)
ans = 10
% without
length^2
Error using length
Not enough input arguments.
I suspect you are trying to refer to the next field in the app, where Length is 64. I suggest just hardcoding the 64. This approach assumes n exists as a variable in the workspace.
sqrt(64^2-n.^2)
  3 件のコメント
Cris LaPierre
Cris LaPierre 2022 年 3 月 7 日
You need to define the variable n. Any variables you use in your expression must exist in your workspace or you will get this error.
In your command window, type n=1 and then press enter. Now that the variable exists, click Apply in the app.
Palguna Gopireddy
Palguna Gopireddy 2022 年 3 月 10 日
Thanks. It is solved.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by