Subscripted assignment dimension mismatch.Error in fnc (line 12) matrix1(1,1)=cos(k*delta_z);matrix1(1,2)=(i/q)*sin(k*delta_z);
Show older comments
i tried to form an matrice and took this error. here is my code.
function [matrix1,matrix2] = fnc(delta_z,w);
delta_z=450e-9;
N_a=2.5;
f=3e14:1e12:5e14;
w=2*pi*f;
k=N_a*(w/3e8);
q_j=-k/(2*pi*f*4*pi*10e-7);
matrix1(1,1)=cos(k*delta_z);matrix1(1,2)=(i/q)*sin(k*delta_z);
matrix2(1,1)=(i*q)*sin(k*delta_z);;matrix2(1,2)=cos(k*delta_z);
end
my aim is to form a matrix like the one in an image and for different layers and multiply them with another matrices. do you suggest any thing? best regards..
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!