MATLAB: ??? Error using ==> mldivide Matrix dimensions must agree.

mldivide error wavelength frequency

Hi everyone, I am trying to divide f0 but it keeps coming up with errors. I tried putting the dot before / as seen below but it is still not working. Am i missing something really simple? Thanks
c = 341; % speed of sound in air
%%% GF as function of Frequency PARAMETERS %%%
f01 = 50:50:500;
x2 = lx; %% far
y2 = ly;
z2 = lz;
% 1 fixed frequency <<
%%Calculated Parameters%%
w= 2 *pi *f01 ; %%angular frequency
lambda = c./f01 ;%%wavelength
k. = (2*pi)./lambda

Best Answer

The dot (vectorising) is a good idea, unless you’re doing true matrix or vector operations. Then it leads to strange results.
These lines:
c = 341;
f01 = 50:50:500;
lambda = c./f01
k = (2*pi)./lambda <+++ this line works when you remove the dot after the k
produce decent-looking vectors for lambda and k. I only see f01, not f0, so I assume we’re looking at the correct section of code.
But then f0 (that does not appear) could be a boson or some other elemental quantity that refuses to be divided further.