Plot signal from list of data in MATLAB

AI Thread Summary
To plot a signal from a .mat file in MATLAB, the user needs to load the data using the 'load' command. The code attempts to extract the size of the loaded data, but it incorrectly uses 'size' on the filename instead of the actual data variable. A proper approach involves creating an x vector that matches the length of the y-data for plotting. The user also seeks assistance with loading the .mat file correctly and using a GUI to select the .m file for execution. Clarifying the data variable after loading the .mat file is essential for successful plotting.
kay310
Messages
8
Reaction score
0
I want to load a .mat file which contain 500 column of data in it and plot the signal out through the GUI using .m file.
Can anyone help me on the code?
 
Physics news on Phys.org
So you have a set of y-data of 300. Make an x vector of size 300 that goes from 0 to 300 and then plot(x,y);
 
I'm now actually unable to load the .mat file using 'load' command.
I doing this way in m-file:

load filename;
[x,y] = size(filename);
t = 1:y;
plot(t, filename);

%the filename is in .mat format
 
can anyone help me in load a .m file and plot the signal out?

using this way:
[Filename, PathName] = uigetfile('*.m','Select the M-file');
 
Thread 'Have I solved this structural engineering equation correctly?'
Hi all, I have a structural engineering book from 1979. I am trying to follow it as best as I can. I have come to a formula that calculates the rotations in radians at the rigid joint that requires an iterative procedure. This equation comes in the form of: $$ x_i = \frac {Q_ih_i + Q_{i+1}h_{i+1}}{4K} + \frac {C}{K}x_{i-1} + \frac {C}{K}x_{i+1} $$ Where: ## Q ## is the horizontal storey shear ## h ## is the storey height ## K = (6G_i + C_i + C_{i+1}) ## ## G = \frac {I_g}{h} ## ## C...

Similar threads

Back
Top