Regression Matlab [closed] - matlab

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 days ago.
Improve this question
Identification of brain areas after language stimuli
Hi guys, I'm trying to solve a problem with my code in matlab. My goal is to identificate brain areas associated to language stimuli. After I performed some tasks, i arrived to plot the convolution between the BOLD signal and square signal (stimuli). Now, my goal is to perform a regression using regress between the convolution result (1x481 matrix) and a matrix containing the number of voxels of my brain images (92614x39) where the rows are the voxels and 39 are the MRI scans. So, the two matrices have different size and I have no idea how to perform a regression. Anyone could help me?

Related

Converting a 2D matrix into a 3D matrix in matlab [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 days ago.
Improve this question
My problem is to convert my 294912x39 2d matrix into a 3D matrix 128X128X18
Using the reshape function in matlab I get errors.So, my idea is to convert it manually. My 2d matrix is 294912x39 and the 3D matrix I need is 128x128x18. Anyone could you help me?

What is the best way to plot 3d data in matlab? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
If i have data in NxN grid format (for example see figure) and each cell size is given by (Xmax/N) x (Ymax/N) and data given in each cell is the frequency data of that cell. What is the best way to graphically represent this data in MATLAB such that it is easy to view the frequency for each cell? If I would like to make it like in this example (see colormap), how can I do that what function should I used?
Your choice. Here I put several possibilities:
bar3: if you the points are discrete by meaning
surf or mesh : if the points are continuous by meaning
-imshow or image
in MATLAB 2017b or newer, heatmap
-contour, if you have a sufficiently detailed data
There may be more, please feel free to add them to the post.

What does linsolve(A,B) return when the number of equations is larger then number of variables? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I by accident put a matrix A with far more rows then columns into linsolve(A,B). So it should be inconsistent system of equations. However what I got was a 'solution' which fits my task far better. So what exactly does it return when you have more columns then rows?
What you have seems to be an overdetermined linear system, that can be solved by the least-square method.
If your matrix A has more rows than columns (m > n) it means that you have more equations than unknowns, so an exact solution can be almost impossible to find. What you can obtain is a good enough solution that minimizes the error.
You can refer to the page Overdetermined system for more insights.

what are the conclusions obtained from this box plot? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have plotted the standard deviation of different regions.Can anyone help me to get the conclusions from this boxplot. I just want to conclude the properties of regions. In this figure, eigth object is odd one. What is the significance of whiskers?
How to change the xlabel as region1 ,region2 etc
Coclusions: wide part of your data does not follow a normal distribution. You need something like Violin Plots to see what is rally happening in your data.
Specially for 3-7, as it seems that the number of the outliers is too big.
But remember: Conclusions are obtained from data, not from the plotting option you chose for your data!
about changing the xlabel.... have you tried the function xlabel....?

matlab indices not in range? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm trying to write the optimal quantization for IP.
I'm new to matlab and in this code, i'm trying to go over every pixel in every interval of Z, multiply it with it's histogram and sum it , so I can calculate the optimal Q.
problem : Attempted to access hist(257);index out of bounds because numel(hist)=256.
for i=1:K,
for j=(Z(i)):Z(i+1),
sum1=(j)*hist(j+1)+sum1;
count=count+hist(j+1);
end
end
The error is telling you that you cannot access hist(257) because the array hist only has 256 elements in it. Note that hist is also a built in function name so you really ought to consider giving your variable a different name.
How to solve:
Think carefully about your code, and what you are trying to achieve. What are Z. hist and K? What is the largest value that j can reach (=Z(i+1))? That is the value with which you are indexing hist, and apparently hist is not that big. What then is the shape of each variable?