필터 지우기
필터 지우기

複数の陰関数を一度にプロットする方法

조회 수: 6 (최근 30일)
高木 範明
高木 範明 2023년 9월 20일
댓글: 高木 範明 2023년 9월 21일
fimplicitを使って、円グラフを例えば3つ同時に描画させるため、つぎのコードを記載しましたが、
うまく動きません。エラーメッセージは次の通りでです。「警告: 関数が配列入力で予期せぬ動作をします。パフォーマンスを向上させるために、入力引数と同じサイズと形状をもつ出力を返すように関数を適切にベクトル化してください。」
どこがまずいのか、ご教示をよろしくお願いいたします。
Ia_start = 1
Ia_end = 5
Ia_count = 2
Ia = Ia_start : Ia_count : Ia_end
figure
fimplicit(@(id,iq) id.^2+iq.^2 - Ia.^2)

채택된 답변

Dyuman Joshi
Dyuman Joshi 2023년 9월 20일
You will have to draw the 3 implicit curves separetly -
Ia_start = 1;
Ia_end = 5;
Ia_count = 2;
figure
hold on
for Ia = Ia_start : Ia_count : Ia_end
fimplicit(@(id,iq) id.^2+iq.^2 - Ia.^2);
end
hold off
xticks(-5:5)
  댓글 수: 1
高木 範明
高木 範明 2023년 9월 20일
Thank you for your prompt guidance.
I understand that it is difficult to plot all at once in fimplicit. I will try to deal with it in the way you have taught me.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Atsushi Ueno
Atsushi Ueno 2023년 9월 20일
This is another method. Creating a function handle (cell) array allows a single call to the fimplicit function.
Ia_start = 1;
Ia_end = 5;
Ia_count = 2;
Ia2 = Ia_start : Ia_count : Ia_end;
fun = arrayfun(@(Ia) @(id,iq) id.^2+iq.^2 - Ia.^2, Ia2, 'uni', false);
figure
fimplicit(fun);
  댓글 수: 1
高木 範明
高木 範明 2023년 9월 21일
Thank you for sharing your wonderful method with me. I was not aware of this method. Thank you again.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!