Respondida
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...

más de 4 años hace | 0

Respondida
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. ...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 1

| aceptada

Respondida
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...

más de 4 años hace | 0

| aceptada

Respondida
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 = ...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 0

| aceptada

Respondida
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.

más de 4 años hace | 0

Respondida
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 = ...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

| aceptada

Respondida
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; ...

más de 4 años hace | 1

| aceptada

Respondida
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...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 1

| aceptada

Respondida
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 ...

más de 4 años hace | 1

| aceptada

Respondida
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/...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

Respondida
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 % ...

más de 4 años hace | 1

| aceptada

Respondida
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....

más de 4 años hace | 1

| aceptada

Respondida
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)...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

Respondida
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(...

más de 4 años hace | 0

Respondida
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; ...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

| aceptada

Respondida
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; ...

más de 4 años hace | 0

Respondida
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 ...

más de 4 años hace | 0

Respondida
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

más de 4 años hace | 0

Cargar más