Answered
GUI Project Help?
I would approach it something like this. I don't know how your figure is set up, but somewhere you should have a list of the s...

4 years ago | 0

Answered
splitting multiple images in a loop
This works without error; however, there were and still are issues that I can't fix without knowing what your intentions are. ...

4 years ago | 0

Answered
Vectorization to store images in a 3D array?
Depending on the image sizes, the waitbar itself is probably wasting the majority of the time. Consider the following test. At...

4 years ago | 0

| accepted

Answered
I am trying to mask values in a matrix that are out of a specified range and trying to make a new matrix from the values after the values out of the range have been masked.
This is all still terribly nonspecific. "Masking" may be generally read as "selecting". What is to happen to the undesired ele...

4 years ago | 0

Answered
How can I replace the centre of imagesc with zero?
A more complex example: % say this is the data size s = [200 200]; % [y x] % and these are the coordinate vectors x = lins...

4 years ago | 0

Answered
radius of rod along its length in an image
I ended up having to do a little manual touchup on the image (attached). It's still not a very good result, and the perspective...

4 years ago | 1

| accepted

Answered
Smoothing contour plot of isotherm
I don't have your data, and your code is a picture, so I can't do anything with it. That said, it looks like the problem is m...

4 years ago | 0

| accepted

Answered
I want to split an image into several pieces and automatically save them without needing to crop them manually. How can I do that?
Without further information, this is a basic example using the following image. I = imread('letterscatter.png'); tiling = ...

4 years ago | 0

Answered
How can I replace the centre of imagesc with zero?
This is one example using a marker. You'll likely have to adjust the marker size to suit your needs. If you want the marker si...

4 years ago | 0

Answered
Is it possible to speed up regionprops function?
Consider the following demonstration of an alternative example. For an 800x1000 logical image with roughly 450 objects, this is...

4 years ago | 0

| accepted

Answered
Want my random matrix to only display distinct elements
Just like so N = 5; A = 1:N^2; A = reshape(A(randperm(N^2)),N,N) If you want to cast the output as integer class, you can.

4 years ago | 0

Answered
Line inside a circle. Hold on not working
Simon is correct. The line as you defined it is 1mm long. % pull parameters out radius = 55; % main circle radius centerX = ...

4 years ago | 0

| accepted

Answered
how to not use all input arguments in the function because some of the arguments are fixed?
If you're writing a function and want certain arguments to be optional (with internal defaults), read about varargin https://ww...

4 years ago | 0

| accepted

Answered
How to create matrix array using while loop and time increment?
Well, that's what happens when you drop an anti-gravity apple. y0 = 2; g = -9.81; tstep = 0.01; t = 0; i = 0; y1 = y0; ...

4 years ago | 1

| accepted

Answered
How can I make this code simpler
Depends what you mean by "simple". Consider the following three options. Method 2 is compact, but it's slower for large inputs...

4 years ago | 0

Answered
I am adding two values together and it is rounding up but I don't need it to round up.
If you simply want to truncate the values to integer cents, consider the example: A = [19.7641, 3.9313, 23.6954] B = truncatec...

4 years ago | 0

Answered
More efficient way than a loop for this particular example
What size is RGB_array? I'm guessing it's a 1x3 tuple, and the LHS of the output assignment is a Mx1x3 region in the output arr...

4 years ago | 1

| accepted

Answered
Currently I am trying to convolve an image with a Gaussian function and am getting a white screen.
Sum-normalize the filter kernel gp = imread('cameraman.tif'); n = 1132; m = 755; sigma = 5; h = zeros(n,m); for x=1:n ...

4 years ago | 1

| accepted

Answered
Converting an image to grayscale with respect to colormap.
Normally, one would convert the indexed image to RGB, and then to grayscale. [idxpict map] = imread('https://www.mathworks.com/...

4 years ago | 0

| accepted

Answered
creating vector from n value
Here's one way: n = [2 4 8 16 32]; N = cell(numel(n),1); for k = 1:numel(n) N{k} = repmat(1/n(k),1,n(k)); end cell...

4 years ago | 0

Answered
Error creating an animated GIF in Matlab
This problem happens when you try to append to a file that doesn't already exist. for i = index_intersection:nfichier % ...

4 years ago | 1

| accepted

Answered
print multiple lines to textarea
You're replacing the contents of the textarea every time. If you want multiple lines, you'll need to concatenate them together....

4 years ago | 1

| accepted

Answered
replace the repeated number in a given sequence with value of zero
This can probably be simplified, but eh. r=22.5; R=linspace(0,10,10); x=repelem(R,3); z=-(r-sqrt(r^2-R.^2)); Z=repelem(z,3)...

4 years ago | 0

| accepted

Answered
Rotate a Rectangle within boundaries
Here. % rectangle parameters szR1 = [1 1]; % size of large rectangle osR1 = [0.2 -szR1(2)/2]; % offset of large rectangle sz...

4 years ago | 0

Answered
Create a permutation of elements in the same position
Consider the example: % input coordinates x = [1 2]; y = [11 22]; z = [111 222]; % create the index array m = (dec2bin(...

4 years ago | 0

Answered
An integer multiple a function
n isn't defined. I'm assuming that's T2? load ecg_hw2.mat; N = [2 4 8 16 32]; b = 1./N; ye = cell(size(b)); t = 1/200; ...

4 years ago | 0

| accepted

Answered
middle coordinates of inclined cylinder
You can use that to get the approximate centroid. % i have no idea how you plotted, %so i'll just throw something into an axe...

4 years ago | 0

| accepted

Answered
Block matrix with random positions of matrices
You can use a cell array to carry the subarrays as they're permuted. % four identifiable subarrays A = [1 1; 1 1]; B = 2*A; ...

4 years ago | 0

Answered
Check if condition happened in previous values
Consider the simplified example: cctbbo = randi([10 99],1,40); BBosline = 20; sl1 = cctbbo < BBosline; % some logical vector ...

4 years ago | 0

Answered
How can I find the sum of numbers using for-loop.
Same question: https://www.mathworks.com/matlabcentral/answers/1649880-finding-the-sum-of-the-number-using-for-loop

4 years ago | 0

Load more