Answered

How can I fix this code?

fprintf('%-15s%-12s\n', 'PRICE', 'QUANTITY'); fprintf('%-15.2f%-12f', pq1, pq2); This likely to be disconcerting to the users,...

How can I fix this code?

fprintf('%-15s%-12s\n', 'PRICE', 'QUANTITY'); fprintf('%-15.2f%-12f', pq1, pq2); This likely to be disconcerting to the users,...

2 days ago | 0

Answered

How can I save just the values of a structure in a .mat file?

I would like to be sure that I understand what you are asking. You have two structures that happen to have 5 fields each. You w...

How can I save just the values of a structure in a .mat file?

I would like to be sure that I understand what you are asking. You have two structures that happen to have 5 fields each. You w...

2 days ago | 0

Answered

How to turn NaN values in only numerical columns into -999?

fillmissing(T1,'constant',{-999,-999,-999,'NaN'}) Note that this will use the character vector 'NaN' (three characters) in plac...

How to turn NaN values in only numerical columns into -999?

fillmissing(T1,'constant',{-999,-999,-999,'NaN'}) Note that this will use the character vector 'NaN' (three characters) in plac...

2 days ago | 0

Answered

Finding Complex root for the nonlinear equation with single variable

Your function returns three outputs for each input y, and the three outputs each have two complex solutions. There is no single ...

Finding Complex root for the nonlinear equation with single variable

Your function returns three outputs for each input y, and the three outputs each have two complex solutions. There is no single ...

2 days ago | 0

Answered

How to plot unit square using single matrix, to apply transformation matrices onto it.

Is it possible to plot a unit square using just a single matrix, such that transformation matrices can be applied to it and refl...

How to plot unit square using single matrix, to apply transformation matrices onto it.

Is it possible to plot a unit square using just a single matrix, such that transformation matrices can be applied to it and refl...

2 days ago | 0

Answered

Subplot problem - plots are on top of each other?

subplot(1,2,1); h1 = axes; The subplot() call creates an axes that covers half of the figure. The axes() call creates an axes ...

Subplot problem - plots are on top of each other?

subplot(1,2,1); h1 = axes; The subplot() call creates an axes that covers half of the figure. The axes() call creates an axes ...

3 days ago | 0

| accepted

Answered

Read 2 frames simultaneously from same video

frameRGB = readFrame(Video); while hasFrame(Video) frameRGB2 = readFrame(Video); %now process like you did frame...

Read 2 frames simultaneously from same video

frameRGB = readFrame(Video); while hasFrame(Video) frameRGB2 = readFrame(Video); %now process like you did frame...

3 days ago | 1

| accepted

Answered

how to find inverse

target_value = 2; inverse_for_target = fzero(@(x) f(x)-target_value, initial_guess);

how to find inverse

target_value = 2; inverse_for_target = fzero(@(x) f(x)-target_value, initial_guess);

3 days ago | 0

Answered

Alpha Blending 2 Matrix Images

Create a binary matrix in the shape of the oval. Take its complement. bwdistgeodesic() with the uncomplemented version. You now ...

Alpha Blending 2 Matrix Images

Create a binary matrix in the shape of the oval. Take its complement. bwdistgeodesic() with the uncomplemented version. You now ...

3 days ago | 0

| accepted

Answered

imfill() causes error in padarray

That line of code does not occur in Mathwork's padarray() in your release. I suspect that you have a third-party padarray.m wh...

imfill() causes error in padarray

That line of code does not occur in Mathwork's padarray() in your release. I suspect that you have a third-party padarray.m wh...

4 days ago | 0

| accepted

Answered

Error: Attempt to execute SCRIPT Update_V_Jacobi_Metal_box as a function

You used Update_V_Jacobi_Metal_box as the name of your script. That prevents MATLAB from finding the function Update_V_Jacobi...

Error: Attempt to execute SCRIPT Update_V_Jacobi_Metal_box as a function

You used Update_V_Jacobi_Metal_box as the name of your script. That prevents MATLAB from finding the function Update_V_Jacobi...

4 days ago | 1

| accepted

Answered

While loop doesn't terminate

http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F

While loop doesn't terminate

http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F

4 days ago | 0

Answered

Why is matlab giving me a a very small number when the answer should be EXACTLY zero?

m=[-1*1.8 1.2 0.6]*[1,1,1]' In scientific computing, the meaning of that is m=[ range(-18/10-5/100,-18/10+5/100,'semiopen'), r...

Why is matlab giving me a a very small number when the answer should be EXACTLY zero?

m=[-1*1.8 1.2 0.6]*[1,1,1]' In scientific computing, the meaning of that is m=[ range(-18/10-5/100,-18/10+5/100,'semiopen'), r...

4 days ago | 0

Answered

How to write numbers before it occurs?

rowidx = find(AAA(:,appropriate_column) ~= 0); for start_row = rowidx(:).' %need to be sure it is a row vector AA(s...

How to write numbers before it occurs?

rowidx = find(AAA(:,appropriate_column) ~= 0); for start_row = rowidx(:).' %need to be sure it is a row vector AA(s...

4 days ago | 0

| accepted

Answered

Why is the background of my custom marker changing color?

imagesc is primarily for pseudocolor images, especially ones in which the data is a range of values that is to be distributed ov...

Why is the background of my custom marker changing color?

imagesc is primarily for pseudocolor images, especially ones in which the data is a range of values that is to be distributed ov...

4 days ago | 1

| accepted

Answered

Adding a new row in a UI table with every iteration

app.UITable.Data = [app.UITable.Data; vars];

Adding a new row in a UI table with every iteration

app.UITable.Data = [app.UITable.Data; vars];

4 days ago | 0

| accepted

Answered

If I want to work on computer vision, and control motors using MatLab, which packages should I buy ?

* Computer Vision * Deep Learning To control motors you could use Arduino, or Raspberry Pi, or you could use Data Acquisitio...

If I want to work on computer vision, and control motors using MatLab, which packages should I buy ?

* Computer Vision * Deep Learning To control motors you could use Arduino, or Raspberry Pi, or you could use Data Acquisitio...

4 days ago | 0

Answered

Force output for function with no output

No, MATLAB does not offer any way of doing that through function handles and operators. You will need to write a small functi...

Force output for function with no output

No, MATLAB does not offer any way of doing that through function handles and operators. You will need to write a small functi...

4 days ago | 0

| accepted

Answered

is it possible to convert 2d image into 3d binary image form?

h = surf(YourImageArray); or more likely h = surf(YourImageArray, 'edgecolor', 'none'); After that you would use https://www....

is it possible to convert 2d image into 3d binary image form?

h = surf(YourImageArray); or more likely h = surf(YourImageArray, 'edgecolor', 'none'); After that you would use https://www....

4 days ago | 0

| accepted

Answered

How to plot 6 similar lines to see more obviously?

Use multiple subplots. Or plot the difference between the lines. Or zoom in, a lot.

How to plot 6 similar lines to see more obviously?

Use multiple subplots. Or plot the difference between the lines. Or zoom in, a lot.

4 days ago | 0

| accepted

Answered

Sound generation with a particular power

help sound sound(Y,FS) sends the signal in vector Y (with sample frequency FS) out to the speaker on platforms that support sou...

Sound generation with a particular power

help sound sound(Y,FS) sends the signal in vector Y (with sample frequency FS) out to the speaker on platforms that support sou...

4 days ago | 0

| accepted

Answered

Setting min value of variables within a function

https://www.mathworks.com/help/matlab/ref/odeset.html#d117e993600 You can set the NonNegative option to the list of variable i...

Setting min value of variables within a function

https://www.mathworks.com/help/matlab/ref/odeset.html#d117e993600 You can set the NonNegative option to the list of variable i...

4 days ago | 1

Answered

Undifined function or variable x

function better_homes_and_gardens R1 = 2; R2 = 1; s1 = [-2;2]; s2 = [3;-1]; n1 = 2; n2 = 1; %...

Undifined function or variable x

function better_homes_and_gardens R1 = 2; R2 = 1; s1 = [-2;2]; s2 = [3;-1]; n1 = 2; n2 = 1; %...

4 days ago | 0

| accepted

Answered

Using symsum within a loop

symbolic variables can never be used as indices, including not in symsum. You should just construct the terms and sum() them s...

Using symsum within a loop

symbolic variables can never be used as indices, including not in symsum. You should just construct the terms and sum() them s...

4 days ago | 1

| accepted

Answered

how to store large data during the execution of a program without getting out of memory

You will need to go through calculating the all partitions and writing them to a file, but keeping only a limited working set in...

how to store large data during the execution of a program without getting out of memory

You will need to go through calculating the all partitions and writing them to a file, but keeping only a limited working set in...

4 days ago | 1

| accepted

Answered

Trouble reading the file with strread and textscan

DataDate=dir('C:**file path in included here**/'); for viv=1:length(DataDate)-3 That code is incorrect. It is an attempt to sk...

Trouble reading the file with strread and textscan

DataDate=dir('C:**file path in included here**/'); for viv=1:length(DataDate)-3 That code is incorrect. It is an attempt to sk...

4 days ago | 0

Answered

Variable 'nb11' originally saved as a NaiveBayes cannot be instantiated as an object and will be read in as a uint32.

The class NaiveBayes is not available when you load the .mat . The NaiveBayes class was removed a few years ago. https://www.m...

Variable 'nb11' originally saved as a NaiveBayes cannot be instantiated as an object and will be read in as a uint32.

The class NaiveBayes is not available when you load the .mat . The NaiveBayes class was removed a few years ago. https://www.m...

4 days ago | 0

| accepted

Answered

shift the first 5 characters of str to the end using loops

You need to create an output vector the same size as the input vector. Then copy from location 6 of input to location 1 of outpu...

shift the first 5 characters of str to the end using loops

You need to create an output vector the same size as the input vector. Then copy from location 6 of input to location 1 of outpu...

4 days ago | 0

Answered

How to quickly find the first NaN?

You could adapt https://www.mathworks.com/matlabcentral/fileexchange/24641-vectorized-find-with-first-option to do the nan tes...

How to quickly find the first NaN?

You could adapt https://www.mathworks.com/matlabcentral/fileexchange/24641-vectorized-find-with-first-option to do the nan tes...

5 days ago | 0

| accepted

Answered

Valid indices are restricted in parlor loop

You cannot do that. Output arrays must be indexed in very simple ways, never as a range computed from the loop variable. You ...

Valid indices are restricted in parlor loop

You cannot do that. Output arrays must be indexed in very simple ways, never as a range computed from the loop variable. You ...

5 days ago | 0