# How to plot a matrix from a bigger matrix?

1 view (last 30 days)
Herline van der Spuy on 30 Jun 2021
Commented: dpb on 30 Jun 2021
Not sure that I worded the title question right, but anyways...
I've got a 165x6 matrix. Columns are:
Frequency, Complex Modulus, Phase Angle, Storage Modulus, Loss Modulus and Temperature.
There are 10 temperatures: -24, -18, -12, 10, 15, 25, 35, 45, 60, 70°C. The first three temperatures (I call these the BBR temps) each only have 6 points. The other 7 temperatures (I call DSR temps) each have 21 points. I need to plot frequency vs complex modulus. I wanted to create a frequency matrix so that all 10 temperatures' frequency values are in it, and the same with the complex modulus, you know so that I can plot those two. But I'm not sure how to do that. So I thought about creating a Frequency matrix for the BBR temps and a frequency matrix for the DSR temps. The same for the complex modulus. And then I could plot the frequency vs complex modulus. But the plot is wrong, the BBR values have the same colour as the DSR ones.
My code and a snip of the matrix:
BBR = [Temp1;Temp2;Temp3]
DSR = [Temp4;Temp5;Temp6;Temp7;Temp8;Temp9;Temp10]
FrequencyBBR(1:6,1:3) = reshape(BBR(:,1),[6, 3])
FrequencyDSR(1:21,1:7) = reshape(DSR(:,1),[21,7])
ComplexBBR(1:6,1:3) = reshape(BBR(:,2),[6,3])
ComplexDSR(1:21,1:7) = reshape(DSR(:,2),[21,7])
scatter(FrequencyBBR,ComplexBBR)
hold on
scatter(FrequencyDSR,ComplexDSR) dpb on 30 Jun 2021
If'en it's just the color, you can set it in the call to scatter

### Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

R2021a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!