If i has supply=0.2x + 20 and p=RandData(1,:) is there a way to substitute p in for x?
1 次查看(过去 30 天)
显示 更早的评论
If i has supply=0.2x + 20 and p=RandData(1,:) is there a way to substitute p in for x?
5 个评论
回答(1 个)
Samatha Aleti
2020-5-3
Hi,
If you have to define “supply” in terms of “x” initially then you can substitute “p” in place of “x” by using “syms” as follows:
syms x
supply=0.2*x + 20 ;
p=RandData(1,:); % As per your code
out = subs(supply, p);
clear x;
Otherwise you can define “p" and then define "supply" in terms of "p" as follows:
p=RandData(1,:);
supply=0.2*p + 20 ;
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assumptions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!