multiplication of equevalant element of three cells by a predetermined vector
Afficher commentaires plus anciens
Hi all; I've written a program including some cells like below:
clc; clear;
s=[ 0 10 20 30];
pr=[0.24 0.40 0.36];
f=[625 425 425; 125 125 125; 25 25 25; 125 125 125];
sm=[30 20 10 0;-10 30 20 10;-10 -10 30 20];
for n=1:10
fmin_init{n}=f;
for t=1:3
for ss=1:4
s2{t,ss}= sm,
for qq=1:3
tsd_intrpln{n,qq}=interp1(s(:),fmin_init{n}(:,qq), s2{t,ss});
end
% my problem is here >> tsd{n,ss}= Pr.* tsd_intrpln{n,:}
end
end
end
I want to multiply each element of matrix "pr" i.e. [0.24 0.40 0.36] respectively by each element of matrix "tsd_intrpln{n,1}" and its equevalant element in "tsd_intrpln{n,2}" and also "tsd_intrpln{n,3}" for example:
-the first element of "tsd_intrpln{n,1}" is multiplied by "pr(1) " . i.e. a11* 0.24
-the first element of "tsd_intrpln{n,2}" is multiplied by "pr(2) " . i.e. a'11* 0.4
-the first element of "tsd_intrpln{n,3}" is multiplied by "pr(3) " . i.e. a''11* 0.36 .
How can I do this. I look forward to reply.m
Réponses (1)
Catégories
En savoir plus sur Matrix Indexing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!