Answered
extrapolation from correlated data
Can you attach some data? If the values are correlated, how about if you scatter one versus the other, then fit a line between...

7 days ago | 0

Answered
How do I replace the last value in the output string to 'and *value*.' instead of ', *value*,'?
Try for i = 1 : N fprintf('%d', i); if ismember(i, result) fprintf(' (prime)'); end if i < N fprintf(', '...

7 days ago | 1

| accepted

Answered
Help with Matlab code
Looks like polyfit() should do it temperature = [......... enthalpy = [........... coefficients = polyfit(temperature, enthal...

7 days ago | 0

| accepted

Answered
How do I create a list where it shows the values from the list 1:N so that in the list it says which numbers are prime?
Try this: N = 55; primeNumbers = primes(N) fprintf('list: '); for k = 1 : N fprintf('%d', k); if ismember(k, primeNumber...

7 days ago | 0

| accepted

Answered
Using one variable containing all name-value pairs for built-in Matlab functions
If you have version 2019b or later version of MATLAB, you might want to use the arguments block. See Loren's latest blog to lea...

7 days ago | 0

Answered
Bandpass filter applied to an image
Hints. One way is to fft2() the image, then zero out some portion of the spectrum, then ifft2(). A second way is to do a dif...

7 days ago | 0

| accepted

Answered
how to do superimposing?
After the first call to plot(), call hold on: hold on;

7 days ago | 0

Answered
How to do normalize distribution technique on a simple matrix?
Try this: pd = fitdist(x, 'Normal') % Get 1000 random numbers from this distribution: r = pd.sigma * randn(1000) + pd.mu; % ...

7 days ago | 1

| accepted

Answered
Radon Transform Documentation Matlab
Think of the Radon transform like an x-ray. It makes a projection along a line. Now the digital image is spatially discrete --...

7 days ago | 1

| accepted

Answered
Switch case transition statement
Try it this way, with an if instead of a switch if switchExpression && ifConditionstatemnet % Run code for case 1, give ou...

7 days ago | 0

Answered
How to read a txt and store in a variable using the linefeed/carriage return
If you want to read a text file line-by-line, do this: % Open the file for reading in text mode. fileID = fopen(fullFileName, ...

7 days ago | 0

Answered
Cannot run anything from script finder
If it's not docked, then clicking outside of it will bring up some other program or the rest of MATLAB. Click the little downwa...

7 days ago | 0

Answered
Particle Trajectories Over Specified Domain
Try this: numPointsX = 640; numPointsY = 480; X = linspace(0, 2, numPointsX); Y = linspace(0, 2, numPointsY); [x, y] = mesh...

8 days ago | 0

Answered
MATLAB showing error : undefined variable
Line 22 assumes that cz got assigned. But if you look at line 7 you'll see that the criteria is never met and so line 8 never g...

8 days ago | 0

Answered
Array indices must be positive integers or logical values.
Take a look at the FAQ.

8 days ago | 0

Answered
mri images in one figure
Ignore it. You don't need to display the numerical values anyway. It should still display the intensity image.

8 days ago | 0

Answered
change color of an object
What I would do to change it from red to pink is to identify the red regions in HSV color space. Then multiply or subtract a va...

8 days ago | 1

Answered
problem with image brain tumor image processing
See my skull stripping demo. It does that.

8 days ago | 2

| accepted

Answered
how measure major and minor axis of ellipse from image used matlab
Try this: clc; % Clear the command window. close all; % Close all figures (except those of imtool.) imtool close all; % ...

8 days ago | 0

| accepted

Answered
How to detect the boundary (binary image)
One way is to call imclose(), then cast the image to double and then blur it with conv2() and threshold it. Then remove any hol...

8 days ago | 0

Answered
Help on a Function
Try this (untested) % This function will be returning a table with 2 columns showing the X and Y of the points where abs(Y)<eps...

8 days ago | 0

Answered
I keep getting a matrix dimensions must agree error message in line 28, does anyone know what is wrong?
Use strcmpi() or strcmp() to compare strings, not ==. if (wordInputFile{i, 2} == yearRange(j)) && strcmpi(wordInputFile{i, 1}, ...

8 days ago | 0

Answered
To improve the significance of the data
Run through all your images calling mean2 Then run through them all again dividing by the mean and getting your gradient with i...

8 days ago | 0

Answered
If I have a logical vector created by ISDIR attribute of DIR, how to have its order by the date of the last modification of folders???
Try this. files = dir('*.*') areAFolder = [files.isdir] files = files(areAFolder) % Get folders only, not files. % Get rid o...

8 days ago | 0

Answered
Array indices must be positive integers or logical values.
The error, probably the most common one we see here, is very well discussed in the FAQ: "Subscript_indices_must_either_be_real_p...

8 days ago | 0

Answered
circle with three points
The answer is in the FAQ: How_can_I_fit_a_circle_to_a_set_of_XY_data?

8 days ago | 0

Answered
Probability visualization with color scale
imshow(yourMatrix, []); colormap(hsv(256)); colorbar;

9 days ago | 0

| accepted

Answered
Why this algorithm produces a relative error?
Don't use sum as the name of your variable. It's the name of a built-in function that you don't want to destroy. See the FAQ: ...

9 days ago | 0

Answered
How to get symmetric data signal
Did you just try plotting negative x: plot(x, y); hold on; plot(-x, y); grid on;

9 days ago | 0

Answered
Array indices must be positive integers or logical values. Error in (line 8) mr(t)=mi-((mi-mf)*(t./tb));
You can't have the 6.5th element of an array. You can have the 6th or 7th but not the 6.5th. Your question is a FAQ, so read t...

10 days ago | 0

Load more