Answered

Array indices must be positive integers or logical values. Error in sym/subsref (line 870)

A thorough discussion of the error is in the FAQ: https://matlab.fandom.com/wiki/FAQ#.22Subscript_indices_must_either_be_real_p...

Array indices must be positive integers or logical values. Error in sym/subsref (line 870)

A thorough discussion of the error is in the FAQ: https://matlab.fandom.com/wiki/FAQ#.22Subscript_indices_must_either_be_real_p...

3 days ago | 0

Answered

Need to get a figure

hFig1 = figure; % Create first figure. hFig2 = figure; % Create second figure. figure(hFig1); % Switch to first figure. % Do ...

Need to get a figure

hFig1 = figure; % Create first figure. hFig2 = figure; % Create second figure. figure(hFig1); % Switch to first figure. % Do ...

4 days ago | 0

Answered

finding roots of equation in matlab

Use roots: r = roots([a, 0, b, 0, c, 0, d]) Try this: % A=a*w^6+b*w^4+c*w^2+d; a = 0.0011 b = 2 c = 3 d = -5000; w = lin...

finding roots of equation in matlab

Use roots: r = roots([a, 0, b, 0, c, 0, d]) Try this: % A=a*w^6+b*w^4+c*w^2+d; a = 0.0011 b = 2 c = 3 d = -5000; w = lin...

4 days ago | 0

Answered

Trying to save the red positions of an image

Oliver, this works: rgbImage = imread('image.png'); subplot(1, 2, 1); imshow(rgbImage); impixelinfo; % Let's you mouse aroun...

Trying to save the red positions of an image

Oliver, this works: rgbImage = imread('image.png'); subplot(1, 2, 1); imshow(rgbImage); impixelinfo; % Let's you mouse aroun...

4 days ago | 0

| accepted

Answered

How to prevent decrement (melting) past 0 until growth increases again?

Another way, inside the loop, is to use the max() function: hsnow(day+1) = max([0, hsnow(day) + snowfall(day) + dh_snow]); h_i...

How to prevent decrement (melting) past 0 until growth increases again?

Another way, inside the loop, is to use the max() function: hsnow(day+1) = max([0, hsnow(day) + snowfall(day) + dh_snow]); h_i...

4 days ago | 0

| accepted

Answered

How to make binary file for each iteration in a loop?

Try this: baseFileName = sprintf('ax_%d_%d_%d.raw', k, j, i); fullFileName = fullfile(folder, baseFileName); % folder can be p...

How to make binary file for each iteration in a loop?

Try this: baseFileName = sprintf('ax_%d_%d_%d.raw', k, j, i); fullFileName = fullfile(folder, baseFileName); % folder can be p...

5 days ago | 0

Answered

Radium decomposes at a rate proportional to the amount present. If a quarter of the original amount disappears after 900 years, what is the percentage lost in 75 years?

Did you see the File Exchange: https://www.mathworks.com/matlabcentral/fileexchange/69106-radioactive-decay-bateman-equation?s_t...

Radium decomposes at a rate proportional to the amount present. If a quarter of the original amount disappears after 900 years, what is the percentage lost in 75 years?

Did you see the File Exchange: https://www.mathworks.com/matlabcentral/fileexchange/69106-radioactive-decay-bateman-equation?s_t...

5 days ago | 0

Answered

How to avoid patch color being included in legend ?

Try this: clc; clear all; close all; x = linspace(-10,10,200); y = sin(4*x); y1 = sin(x); figure; hold on patch([2 5 5...

How to avoid patch color being included in legend ?

Try this: clc; clear all; close all; x = linspace(-10,10,200); y = sin(4*x); y1 = sin(x); figure; hold on patch([2 5 5...

5 days ago | 0

| accepted

Answered

make vectors same length

Maybe this: lastRow = min([length(acc), length(gyr), length(mag)]) % Crop acc = acc(1 : lastRow); gyr = gyr(1 : lastRow); m...

make vectors same length

Maybe this: lastRow = min([length(acc), length(gyr), length(mag)]) % Crop acc = acc(1 : lastRow); gyr = gyr(1 : lastRow); m...

5 days ago | 1

Answered

writetable adds unnecessary columns to Excel file

I see no such extra columns. Are you sure they're not still existing from a prior run where you forgot to transpose the variabl...

writetable adds unnecessary columns to Excel file

I see no such extra columns. Are you sure they're not still existing from a prior run where you forgot to transpose the variabl...

5 days ago | 0

| accepted

Answered

Sampling of a sinusoidal signal.

Here's a start: clc; % Clear the command window. fprintf('Beginning to run %s.m.\n', mfilename); close all; % Close all f...

Sampling of a sinusoidal signal.

Here's a start: clc; % Clear the command window. fprintf('Beginning to run %s.m.\n', mfilename); close all; % Close all f...

5 days ago | 0

Answered

Converting my code to matlab

You don't need to declare the type of a variable in advance (uint8, int, etc.) Opening braces are not needed to start a loop an...

Converting my code to matlab

You don't need to declare the type of a variable in advance (uint8, int, etc.) Opening braces are not needed to start a loop an...

5 days ago | 0

Answered

how to inverse the output image to show image like sketch

To invert the image subtract from 1: FMag = 1 - FMag;

how to inverse the output image to show image like sketch

To invert the image subtract from 1: FMag = 1 - FMag;

5 days ago | 0

Answered

Join curves of an image, identify which curves have to be joined

I'm attaching two edge linking demos. Adapt as needed - sorry I can't do that for you (not enough time).

Join curves of an image, identify which curves have to be joined

I'm attaching two edge linking demos. Adapt as needed - sorry I can't do that for you (not enough time).

6 days ago | 0

Answered

Deblurring an Image using inverse filtering

You have to do the division in Fourier space. You're doing it in the spatial domain, AFTER you've converted your image back to ...

Deblurring an Image using inverse filtering

You have to do the division in Fourier space. You're doing it in the spatial domain, AFTER you've converted your image back to ...

6 days ago | 1

Answered

fill rectangles with colors

Try this: numRects = 20; positions = rand(numRects, 4); % Positions = [x, y, width, height] % this way you will have more con...

fill rectangles with colors

Try this: numRects = 20; positions = rand(numRects, 4); % Positions = [x, y, width, height] % this way you will have more con...

6 days ago | 1

Answered

fill rectangles with colors

Did you try the rectangle() function? It has options for 'FaceColor', and 'EdgeColor'.

fill rectangles with colors

Did you try the rectangle() function? It has options for 'FaceColor', and 'EdgeColor'.

7 days ago | 1

Answered

Represent data as image using color amplitude and hue

You could try something like this: Sounds like 3-D data to me. Or even two separate 2-D images. So try [rows, columns, numCo...

Represent data as image using color amplitude and hue

You could try something like this: Sounds like 3-D data to me. Or even two separate 2-D images. So try [rows, columns, numCo...

7 days ago | 0

| accepted

Answered

Just want to learn how to better

Here's your answer : Mathworks blog on covid-19 xrays

Just want to learn how to better

Here's your answer : Mathworks blog on covid-19 xrays

8 days ago | 0

| accepted

Answered

how to input to "imread" using uint8 vector that is equivalent to binary data of image file from fread

Of course imread() will "recognize" the image file on disk as a uint8 jpg image if you got it written out properly. I don't kno...

how to input to "imread" using uint8 vector that is equivalent to binary data of image file from fread

Of course imread() will "recognize" the image file on disk as a uint8 jpg image if you got it written out properly. I don't kno...

8 days ago | 0

Answered

growing bubbles with a predetermined radius in a given volume?

Try the tag link on the right for "circle packing".

growing bubbles with a predetermined radius in a given volume?

Try the tag link on the right for "circle packing".

8 days ago | 0

Answered

Divided interest of space (ROI) into continuous cubes

Description example labels = segmentLidarData(ptCloud,distThreshold) segments organized 3-D range data ptCloud into clusters. ...

Divided interest of space (ROI) into continuous cubes

Description example labels = segmentLidarData(ptCloud,distThreshold) segments organized 3-D range data ptCloud into clusters. ...

9 days ago | 0

Answered

How can one extract this vector from a matrix?

Try splitapply(): % Get sample data: M = rand(60, 3); M(:, 1) = repmat([1:12]', 5, 1) % Make months repeating in the first co...

How can one extract this vector from a matrix?

Try splitapply(): % Get sample data: M = rand(60, 3); M(:, 1) = repmat([1:12]', 5, 1) % Make months repeating in the first co...

9 days ago | 1

Answered

How to save a figure through each run of a for loop?

Try export_fig: http://blogs.mathworks.com/pick/2010/05/28/creating-and-exporting-publication-quality-graphics/

How to save a figure through each run of a for loop?

Try export_fig: http://blogs.mathworks.com/pick/2010/05/28/creating-and-exporting-publication-quality-graphics/

9 days ago | 0

Answered

How to save a figure through each run of a for loop?

If you have r2020a or later, try exportgraphics().

How to save a figure through each run of a for loop?

If you have r2020a or later, try exportgraphics().

10 days ago | 0

Answered

Creating one histogram for a multiple DICOM images

See the FAQ: https://matlab.fandom.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F In the loop, simply add the counts fro...

Creating one histogram for a multiple DICOM images

See the FAQ: https://matlab.fandom.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F In the loop, simply add the counts fro...

10 days ago | 0

| accepted

Answered

How can i save the scatter in GUI?

If you have r2020a, use exportgraphics().

How can i save the scatter in GUI?

If you have r2020a, use exportgraphics().

10 days ago | 0

Answered

How to define 1000*1000 matrix in matlab? Whenever I want to define a matrix 1000*1000, out of memory message was shown. Can anyone please help me?

Try this to get a 1000-by-1000 matrix rows = 1000; columns = 1000; A = zeros(rows, columns);

How to define 1000*1000 matrix in matlab? Whenever I want to define a matrix 1000*1000, out of memory message was shown. Can anyone please help me?

Try this to get a 1000-by-1000 matrix rows = 1000; columns = 1000; A = zeros(rows, columns);

10 days ago | 0

Answered

dE values in an image search

Code for that is in the demo in my File Exchange: https://www.mathworks.com/matlabcentral/fileexchange/31118-color-segmentation-...

dE values in an image search

Code for that is in the demo in my File Exchange: https://www.mathworks.com/matlabcentral/fileexchange/31118-color-segmentation-...

10 days ago | 0

| accepted

Answered

Make a standalone app

Yes, you need the compiler toolbox. See the FAQ: https://matlab.fandom.com/wiki/FAQ#How_can_I_make_a_standalone_executable_from...

Make a standalone app

Yes, you need the compiler toolbox. See the FAQ: https://matlab.fandom.com/wiki/FAQ#How_can_I_make_a_standalone_executable_from...

10 days ago | 2