Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Substituting value from table into equation

3 vues (au cours des 30 derniers jours)
Sheryl
Sheryl le 12 Mar 2013
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 commentaire
Walter Roberson
Walter Roberson le 12 Mar 2013
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

Réponses (1)

Youssef  Khmou
Youssef Khmou le 12 Mar 2013
Modifié(e) : Youssef Khmou le 12 Mar 2013
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,

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by