Plotting inequality using symbolic function

9 ビュー (過去 30 日間)
Subakaran
Subakaran 2025 年 4 月 10 日
回答済み: Walter Roberson 2025 年 4 月 10 日
Hi, I have four symbolic functions, say y_caseA, y_caseB, y_caseC, and y_caseD, and I want the region that satisfies
ineq = (Y > y_caseA) & (Y < y_caseB) & (Y<y_caseC) & (Y>y_caseD);
Can someone please help with this. Thank you

回答 (1 件)

Walter Roberson
Walter Roberson 2025 年 4 月 10 日
syms Y
y_caseA = 5;
y_caseB = 10;
y_caseC = 7;
y_caseD = 3;
ineq = piecewise((Y > y_caseA) & (Y < y_caseB) & (Y<y_caseC) & (Y>y_caseD),1,0)
ineq = 
fplot(ineq, [0 15])
ylim([-.1 1.1])

Community Treasure Hunt

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

Start Hunting!

Translated by