Info
此问题已关闭。 请重新打开它进行编辑或回答。
Substituting value from table into equation
1 次查看(过去 30 天)
显示 更早的评论
If i have value in table form and equation
a={1 2; 3 4; 5 6}, where column 1=x , column 2=y
c=(exp(2*x)/100)+((y^3)/10)
how can i get value x and y, and substitute into the equation, and obtain the answer for individual set, then put it into matrix form?
Thank you
1 个评论
Walter Roberson
2013-3-12
Please read the guide to tags and retag your question (and please go back and retag your other questions.) See http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags
回答(1 个)
Youssef Khmou
2013-3-12
编辑:Youssef Khmou
2013-3-12
hi,
You extract the values like the following :
a=(1:10)'*(1:10); % a contains 10 lines and 10 columns,the first column is x
%and the second one is y :
% Two ways :
C1=exp((2*a(:,1))./100)+((a(:,2).^3)/10);
% or :
x=a(:,1);
y=a(:,2);
C2=exp(2*x./100)+((y.^3)/10);C2=exp(2*x./100)+((y.^3)/10);
You put the result in matrix :
N=10; % depends on your operations
C=zeros(10,N);
C(:,1)=C1; % or C2 and so on,
0 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!