Réponse apportée
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...

plus de 4 ans il y a | 0

Réponse apportée
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. ...

plus de 4 ans il y a | 0

Réponse apportée
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...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 0

Réponse apportée
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...

plus de 4 ans il y a | 0

Réponse apportée
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...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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 = ...

plus de 4 ans il y a | 0

Réponse apportée
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...

plus de 4 ans il y a | 0

Réponse apportée
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...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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.

plus de 4 ans il y a | 0

Réponse apportée
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 = ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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; ...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 0

Réponse apportée
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...

plus de 4 ans il y a | 0

Réponse apportée
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...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
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 ...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
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/...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 0

Réponse apportée
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 % ...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
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....

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
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)...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 0

Réponse apportée
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(...

plus de 4 ans il y a | 0

Réponse apportée
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; ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
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; ...

plus de 4 ans il y a | 0

Réponse apportée
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 ...

plus de 4 ans il y a | 0

Réponse apportée
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

plus de 4 ans il y a | 0

Charger plus