#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

#### Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

# help with probably one of the simplest problem...

Posts: 2Member
Hi guys, I'm very new to Matlab... I've been using mathematica but my professor insisted that I should start using matlab... This code is about plotting the magnitude of 'gamma'. The domain of the horizontal axis is frequency, and I want it such that I could modify the sampling rate easily.
When I run the code, I get an error saying that the matrix doesn't match...

[code]
%universal constants
c = 345;
rho = 407 / c;
L = 1;

%frequency here
N = 5; % number of sections
dx = L / N;
T = (L / c) / N;
Fs = 1 / T; % sample rate required
npoints = 2^12;
f = linspace(0, Fs, npoints); % frequency vector

%equations here
w = 2*pi*f;
s = i*w;
rc = 0.00375;
Ac = pi*(rc^2);