Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Substituting value from table into equation

1 visualizzazione (ultimi 30 giorni)
Sheryl
Sheryl il 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 Commento
Walter Roberson
Walter Roberson il 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

Risposte (1)

Youssef  Khmou
Youssef Khmou il 12 Mar 2013
Modificato: Youssef Khmou il 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,

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by