Implementation of a matrix
Mostra commenti meno recenti
Hello!
I want to implement a function, which has n as an input an outputs the following matrix:

Can someone help me please?
2 Commenti
madhan ravi
il 18 Giu 2020
Huh... why waste others time by asking a question if it’s going to be deleted anyway??
Rena Berman
il 12 Ott 2020
(Answers Dev) Restored edit
Risposta accettata
Più risposte (2)
Vishal Gaur
il 16 Giu 2020
Code to generate the mentioned output is:
for i=x
for j=1:n
matCos(i,j) = cos(j*x(i)*exp(1));
end
end
David Hill
il 16 Giu 2020
If x and e are symbolic
syms x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 e;
x=[x1 x2 x3 x4 x5 x6 x7 x8 x9 x10];
for k=1:n
y(k,:)=cos((1:n)*k*x(k)*e);
end
Categorie
Scopri di più su Matrix Indexing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!