Answered
Unable to perform assignment because the size of the left side is 128-by-128 and the size of the right side is 128-by-128-by-3. Error in ind2rgb (line 34) rout(:,:,1) = r;
Okay, after looking a few things up, it seems you're running some version prior to ~R2018x. Given that, the input dimensionalit...

5 years ago | 0

Answered
Flipping a matrix diagonally
I'm assuming you want to flip the whole matrix diagonally To flip about the southeast-northwest diagonal is just transpose: A ...

5 years ago | 2

| accepted

Answered
Experts of MATLAB, how did you learn? Any advice for beginner/intermediate users?
Everyone else here has covered what are arguably the more useful answers. I'm no expert, but I think one point that hasn't been...

5 years ago | 3

Answered
Extraction of object boundaries from an image
I don't know why everyone loves to hand out complete garbage test images for assignments like this. I lopped off the plot box a...

5 years ago | 2

| accepted

Answered
For loop with two conditions
Considering all the comparisons that are being made between unknown variables, I'm not eager to guess at what should be expected...

5 years ago | 1

| accepted

Answered
How to automatically judge points belong to the corresponding sections in a 2D square
This is something in that direction. There are probably canonical ways of doing this, but I'm not familiar with that. Instead ...

5 years ago | 0

| accepted

Answered
How to do Image Segmentation on multiple digit?
Don't rescale the characters in a way that changes their aspect ratio. Resize based only on one dimension, then make up for it ...

5 years ago | 0

| accepted

Answered
How to count dots and mark those dots with crosses in an Image?
As far as I can tell, your sample image is corrupted. Either way, you can do this: % find centers of objects S = regionprops(...

5 years ago | 0

| accepted

Answered
Enclosing Boundary - for blobs
I'll throw this out there. I'm assuming that the goal here is density-dependent (linear) mask constriction. On that assumption...

5 years ago | 1

Answered
How to deal with dimension of the both sides?
Start here X1_bar_i =[9.59547499999917 58282.181075 35.4837749999997 58288.903275 ...

5 years ago | 0

| accepted

Answered
Paint by numbers with Matlab. Imcontour function
This isn't really complete, but I'm not really sure that the best approach is found down that road. I'm using this as my test i...

5 years ago | 2

| accepted

Answered
Set limit for vertical or z dimension in surfl command
If you're refreshing the plot in a loop and want the extents of the z-axis fixed, just do zlim([lowerlimit upperlimit])

5 years ago | 0

Answered
array counting in not happening
Your index i isn't valid because it's a complex number. i = sqrt(-1); This is a good example of why you shouldn't be using i o...

5 years ago | 0

Answered
How to make a normalized matrix ?
If you just want to normalize the array such that its extrema correspond to [0 1], then for a given array A: mn = min(A(:)); m...

5 years ago | 0

Answered
Find the average of all cells in a row.
Something like this: S = load('12X10Cell.mat'); A = S.AX_; % since all the cells just contain equal length vectors, just co...

5 years ago | 0

| accepted

Answered
How to read a subplot as an image and find correlation for two images?
This is one way: % example images and points % points to plot [x y], one point per row inpict1 = imread('cameraman.tif'); in...

5 years ago | 0

| accepted

Answered
can't find bintprog solver matlab2016
bintprog() does not exist in R2016 It was essentially replaced with intlinprog() in R2014a Refer here https://www.mathworks....

5 years ago | 1

| accepted

Answered
How to assign a different colour for each layer?
Assuming you're using bar3() % make some example data maxlayers = 5; z = randi(maxlayers,10,10); h = bar3(z); % the plot ...

5 years ago | 0

| accepted

Answered
Axis ticks alternating between appearing on either side of the plot.
For what it's worth, nsmp = 20; % test data parameters nsig = 8; w = 0.9; % label spreading weight % make random test dat...

5 years ago | 1

Answered
Clubbing of two matrices rows altenately
Try something like: A = [1 3 4 5 7; 4 5 6 6 7; 5 3 2 1 2; 2 2 2 3 4]; B = [1 1 1 2 3 ; 1 2 4 6 7; 3 5 6 7 8]; C = zeros(siz...

5 years ago | 1

| accepted

Answered
How can I reduce the for loop number?
No loops necessary. x_data = [2 6 7 9; 4 9 11 14]; y_data = [8 10 16 31; 15 18 21 24]; x = diff(x_data,1,1).^2 y = diff(y_da...

5 years ago | 1

Answered
Calculate the sum of all the relations between a matrix components
This could be done various ways. You could do this with loops if it's easier to understand. I'll just do this: % example inpu...

5 years ago | 1

| accepted

Answered
Finding location with image processing method
Given that this was probably done by drone, I'm going to assume that framing and camera position are not practically repeatable....

5 years ago | 0

Answered
How can I generate three random matrices from 20 percent of the rows of a 2000 by 80 matrix, using for loop?
I don't see why a loop is necessary. Is it? A = rand(2000,80); % test array s = size(A,1); nrows = round(s*0.2); X1 = A(r...

5 years ago | 0

| accepted

Answered
Create a row vector
one way: x = 1:2.25:10 another way x = linspace(1,10,5) of course, nothing says the vector had to be linear: x = logspace(...

5 years ago | 3

| accepted

Answered
Extract the center blob of an image
Well there's this inpict = imread('dots18.jpg')>128; L = bwlabel(inpict); S = regionprops(inpict,'centroid'); C = vertcat(...

5 years ago | 0

| accepted

Answered
Create a Loop for this process
Generally, using a bunch of numbered variables is something you should try to avoid. https://www.mathworks.com/matlabcentral/...

5 years ago | 0

Answered
problem at smooting the spline
You could try doing something like this instead of trying to enforce endslopes x = [0.0 0.5 0.75 1.250 2.5 5.0 ...

5 years ago | 0

| accepted

Answered
How can I overlay two images with different colormaps in App Designer?
To replicate the behavior of the original post without relying on plot tools: % these are our test images with arbitrary data r...

5 years ago | 0

Answered
How to save image with floating number name?
You mean something like this? mypict = rand(100); mn = mean(mypict(:)); filename = sprintf('the_mean_pixel_value_is_%.4e.pn...

5 years ago | 0

Load more