필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Substituting value from table into equation

조회 수: 1 (최근 30일)
Sheryl
Sheryl 2013년 3월 12일
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
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
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,

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by