## Retrieving Arrays Within Set of Matrices

Hello,

I have several sets of data that I want to plot on one graph. The problem is that each data set is in its own matrix. For instance, I have a 36×4 matrix (let’s call it M). In each of the cells in the 4th column is a 516×2 matrix, corresponding to x and y values. The x values are the same for each of the 516×2 matricies, so I just want to plot the y values against one set of x values. I try to make an additional matrix (let’s call it N) to have the y values all side by side by using the following code

N=[M{:,4}(:,2)]

But then I get the following error

Intermediate brace ‘{}’ indexing produced a comma-separated list with 36 values, but it must produce a single value when followed by subsequent indexing operations.

The end goal is to be able to use this after iterative peak fitting across multiple similar data sets, but I need to be able to efficiently visualize the resulting plots. I would be grateful for any help on this. Thank you!Hello,

I have several sets of data that I want to plot on one graph. The problem is that each data set is in its own matrix. For instance, I have a 36×4 matrix (let’s call it M). In each of the cells in the 4th column is a 516×2 matrix, corresponding to x and y values. The x values are the same for each of the 516×2 matricies, so I just want to plot the y values against one set of x values. I try to make an additional matrix (let’s call it N) to have the y values all side by side by using the following code

N=[M{:,4}(:,2)]

But then I get the following error

Intermediate brace ‘{}’ indexing produced a comma-separated list with 36 values, but it must produce a single value when followed by subsequent indexing operations.

The end goal is to be able to use this after iterative peak fitting across multiple similar data sets, but I need to be able to efficiently visualize the resulting plots. I would be grateful for any help on this. Thank you! Hello,

I have several sets of data that I want to plot on one graph. The problem is that each data set is in its own matrix. For instance, I have a 36×4 matrix (let’s call it M). In each of the cells in the 4th column is a 516×2 matrix, corresponding to x and y values. The x values are the same for each of the 516×2 matricies, so I just want to plot the y values against one set of x values. I try to make an additional matrix (let’s call it N) to have the y values all side by side by using the following code

N=[M{:,4}(:,2)]

But then I get the following error

Intermediate brace ‘{}’ indexing produced a comma-separated list with 36 values, but it must produce a single value when followed by subsequent indexing operations.

The end goal is to be able to use this after iterative peak fitting across multiple similar data sets, but I need to be able to efficiently visualize the resulting plots. I would be grateful for any help on this. Thank you! matrix MATLAB Answers — New Questions