split image and create a new one using this pieces
Does this do what you want: % make an example image A = randi(128,128); % chop it up into 32 x 32 squares B = reshape(A,32...

16 days ago | 1

How to collapse a subsystem in Simulink
Just go back up one level to the parent

16 days ago | 1

| accepted

Need help with creating a function of three parameters
You're close. Just put the formulaes inside of the function, and return the outputs of interest. Something like the code shown b...

17 days ago | 1

| accepted

Storing of output in a for loop
A=xlsread('Values.xlsx','Sheet1','A2:A3204'); count=0; % assign x x = 0:50:7500; % preallocate vector to hold counts numC...

17 days ago | 0

Creating a logic vector out of 2D matrix
%M matrix M = [1 2; 2 0; 3 1; 4 0; 5 3; 6 0; 7 2; 8 4; 9 0; 10 1]; % logic vector...

22 days ago | 0

Color each boxplot differently
I think this should get you closer to what you want. You can select other colors using their rgb color codes, I just used red,gr...

23 days ago | 0

Repeating for loop N times
You need to use a nested for loop, so something like this, where I have assumed that H,D,K,J are length, numLoops vectors. You c...

27 days ago | 0

How do I resolve these two lines separately?
It looks like you may have already answered your own question, but I think this is a little cleaner approach to do the same thin...

28 days ago | 1

How do I make a vector of doubles continuous?
use interp1 so for example if you wanted "continuous" values at 1.2, 2.8, and 3.7, 33.5 xq = [1.2,2.8,3.7,33.5]; % query point...

28 days ago | 0

| accepted

Call MATLAB function in appdesigner
It looks like your function just creates a variable called robotMTH and doesn't use anything in the app object to do its calcula...

28 days ago | 0

Setting elements of an array to be zero based on the values of a vector
I think you want to look at every possible pair of indices that could be made out of the elements of b and set those elements of...

28 days ago | 0

Find all y values for single x in polyshape plot
You can use the intersect function for this, for example pgon = polyshape([0 0 1 1],[1 0 0 1]) endpoints = intersect(pgon,[0.2...

29 days ago | 1

| accepted

How to count active faults in a specific time interval
Here is another approach (uses repelem trick from @Jan https://www.mathworks.com/matlabcentral/answers/382011-how-to-count-the-n...

29 days ago | 0

Removing multiple columns from a matrix
I think this will do what you want for k = 1:numel(b) a(k,:) = [a(k,b(k)+1:end),zeros(1,b(k))] end

29 days ago | 0

| accepted

How to run a Matlab script asynchronously from a Matlab app?
One way would be to use a MATLAB timer and make your script that you want to execute asynchonously be the timer's callback funct...

1 month ago | 0

| accepted

How to use a saved figure in an existing plot?
I think this may get you what you want https://www.mathworks.com/matlabcentral/answers/3901-merging-two-figures

2 months ago | 0

How to extract table data based on column values?
Could be you should be using strcmp rather than == to compare the strings It's a little hard to know exactly how you have the d...

2 months ago | 0

How to generate Pattern in MATLAB
For the first plot you show, you could do something like this (you can adjust the exact scaling) x=linspace(0,0.1) xr = 0.1/3 ...

2 months ago | 0

Cant change directory between loops
Looking at your loops the logic seems basically OK but I can't run it to see exactly what happens as I don't have your image dir...

2 months ago | 0

Extracting unique rows from cell array Matlab 2015a
I'm not sure what you mean by 'unique" in your question title. In the example you give, it looks like you just want to sort the ...

2 months ago | 0

| accepted

Unrecognized function or variable 'dudx'.
As far as I can tell, unless it is in a toolbox that I don't have there is no built in MATLAB function called dudx. If you thin...

2 months ago | 0

| accepted

Plot of head against velocity data based on timestamp similarity
First read in both of your datafiles. Then use MATLAB function interp1 to interpolate values at times matching the times in one...

2 months ago | 1

| accepted

How to split a number into 5 parts equalling the sum of the number
Not sure exactly what you are expecting, but obviously if your total number of rows is not a multiple of 5 then you cannot split...

2 months ago | 0

From frequency to time domain
If I understand what you are asking for correctly I am assuming that your matrix S has the fft of the original time domain data....

3 months ago | 0

| accepted

The voltage and current of the panel at maximum power point ?
You could use this approach. Suppose you first calculate (as I think you show above) equal length vectors of current, I, and vo...

3 months ago | 1

| accepted

Extract rows from a cell array based on keywords
Let say you call your cell array A, then you could do this: % make first column into numerical values rather than strings x = ...

4 months ago | 0

| accepted

It looks like your problem may be that you have a SISO (single input single output) transfer function block (Gnm) but the input ...

4 months ago | 0

| accepted

How do I access AppDesigner variables in a function that I write and call?
So I'm understanding that you have written a function and want to call it from within your appdesigner app. You then want this f...

4 months ago | 1

How can I find the last alpha_k value?
I was just going through your code and made a corrected version. I see now that Torsten has also given you a comment that echos ...

4 months ago | 0

| accepted