How to assign pair of values to a single aeeay in the matrix using two different vectors
34 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
fsine=50e6:0.4e9:3e9;
Vp=0:0.5:3;
I need to form a matrix such that columns correspons to different Vp for a single fsine.
the first column should be for fsine=50e6 for all values for Vp and second column should be fsine=50e6+0.1e9 for all values in Vp
The final vector should be have 7 rows and 8 columns.
0 Kommentare
Antworten (2)
sai charan sampara
am 30 Jun. 2024 um 7:51
Hi Yogesh
The following code might help you:
fsine=50e6:0.4e9:3e9
Vp=0:0.5:3
M=zeros(7,8);
for idx1=1:7
for idx2=1:8
M(idx1,idx2)=sin(fsine(idx2)*Vp(idx1));
end
end
M
1 Kommentar
Chuguang Pan
am 30 Jun. 2024 um 8:35
fsine = 50e6:.4e9:3e9;
Vp = 0:.5:3;
M=sin(Vp.'*fsine)
Siehe auch
Kategorien
Mehr zu Geology finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!