41,361 total contributions since 2011

I do not do free private consulting. If you want to bring my attention to something, send a link to the MATLAB Answers location.

Answered

Double vs Single Precision, Matlab in 2019

>> x = linspace(single(0),single(pi),20); >> y = single(rand(1,20)); >> z = interp1(x, y, linspace(single(0),single(1),20)) z...

Double vs Single Precision, Matlab in 2019

>> x = linspace(single(0),single(pi),20); >> y = single(rand(1,20)); >> z = interp1(x, y, linspace(single(0),single(1),20)) z...

2 hours ago | 0

Answered

Is there any way to separate the terms of a product?

If you have the Symbolic Toolbox, then f = @(x) exp(x-2)*log(x) syms x temp = f(x); op0 = feval(symengine, 'op', temp, 0) r...

Is there any way to separate the terms of a product?

If you have the Symbolic Toolbox, then f = @(x) exp(x-2)*log(x) syms x temp = f(x); op0 = feval(symengine, 'op', temp, 0) r...

2 hours ago | 0

Answered

How to install and enable Symbolic Math Toolbox

https://www.mathworks.com/matlabcentral/answers/101885-how-do-i-install-additional-toolboxes-into-an-existing-installation-of-ma...

How to install and enable Symbolic Math Toolbox

https://www.mathworks.com/matlabcentral/answers/101885-how-do-i-install-additional-toolboxes-into-an-existing-installation-of-ma...

2 hours ago | 0

Answered

How do I install additional toolboxes into an existing installation of MATLAB?

In sufficiently new versions of MATLAB, there is an additional installation method for Mathworks toolboxes that you have already...

How do I install additional toolboxes into an existing installation of MATLAB?

In sufficiently new versions of MATLAB, there is an additional installation method for Mathworks toolboxes that you have already...

2 hours ago | 0

Answered

Outputting solutions to symbolic variables in a matrix.

It sounds like Matrix is now an array of symbolic expressions, some probably representing just numbers, and some probably repres...

Outputting solutions to symbolic variables in a matrix.

It sounds like Matrix is now an array of symbolic expressions, some probably representing just numbers, and some probably repres...

3 hours ago | 0

Answered

Command window showing the errror 'Index exceeds matrix dimensions'. How to resolve it? Following is my code if possible resolve the code.

Somehow you accidentally assigned a value to a variable named imageInputLayer, so the line of code now refers to the variable, i...

Command window showing the errror 'Index exceeds matrix dimensions'. How to resolve it? Following is my code if possible resolve the code.

Somehow you accidentally assigned a value to a variable named imageInputLayer, so the line of code now refers to the variable, i...

3 hours ago | 0

Answered

Newtons Method, help calling anon function inside of function file

You are calling the anonymous function properly in your code. Your problem is that you are not passing in an anonymous function...

Newtons Method, help calling anon function inside of function file

You are calling the anonymous function properly in your code. Your problem is that you are not passing in an anonymous function...

18 hours ago | 1

Answered

Eigenvalue With a twist...

bwep = solve(beep, x) This can be somewhat slow by 4 x 4 A, and by 5 x 5 it might just give you a bunch of roots() because of t...

Eigenvalue With a twist...

bwep = solve(beep, x) This can be somewhat slow by 4 x 4 A, and by 5 x 5 it might just give you a bunch of roots() because of t...

18 hours ago | 0

Answered

converting vector to 3d array

rgb2gray(reshape(TheVector, 32, 32, 3)) for any one vector of length 3072 (1024 x 1024 x 3). The result would be 2D, 32 x 32 . ...

converting vector to 3d array

rgb2gray(reshape(TheVector, 32, 32, 3)) for any one vector of length 3072 (1024 x 1024 x 3). The result would be 2D, 32 x 32 . ...

18 hours ago | 0

Answered

How to run optmization on vectors?

That particular error message has several possible causes: You have accidentally called your own MATLAB script fminsearch which...

How to run optmization on vectors?

That particular error message has several possible causes: You have accidentally called your own MATLAB script fminsearch which...

19 hours ago | 1

Answered

What will happen if you bought a MATLAB Student license after you graduated university?

MATLAB Student licenses never expire. However, you only have permission to use a Student license while you are enrolled in an ap...

What will happen if you bought a MATLAB Student license after you graduated university?

MATLAB Student licenses never expire. However, you only have permission to use a Student license while you are enrolled in an ap...

19 hours ago | 2

| accepted

Answered

Is there a way to extract data from surface graphics in the curvefitting toolbox?

Experimenting, I find: s = findall(groot,'tag','curvefit.gui.FunctionSurface'); x = s.XData; y = s.YData; z = s.ZData;

Is there a way to extract data from surface graphics in the curvefitting toolbox?

Experimenting, I find: s = findall(groot,'tag','curvefit.gui.FunctionSurface'); x = s.XData; y = s.YData; z = s.ZData;

21 hours ago | 0

Answered

Index in position 2 exceeds array bounds (must not exceed 6)?

for loops always evaluate all of their parameters first and record them before executing the loop body. Therefore the value of l...

Index in position 2 exceeds array bounds (must not exceed 6)?

for loops always evaluate all of their parameters first and record them before executing the loop body. Therefore the value of l...

22 hours ago | 0

Answered

Change colors' short names or add new ones

No. They are hardcoded into function colstyle for validation purposes. On OS-X that is part of libmwhgbuiltins.dylib

Change colors' short names or add new ones

No. They are hardcoded into function colstyle for validation purposes. On OS-X that is part of libmwhgbuiltins.dylib

22 hours ago | 2

| accepted

Answered

Function With While Loop Help

At each step, you can determine h (height) by knowing the current volume remaining and knowing the cross-section area of the ves...

Function With While Loop Help

At each step, you can determine h (height) by knowing the current volume remaining and knowing the cross-section area of the ves...

23 hours ago | 0

Answered

How to create a transparent, rectangular patch with rounded corners?

See http://mathworld.wolfram.com/Superellipse.html

How to create a transparent, rectangular patch with rounded corners?

See http://mathworld.wolfram.com/Superellipse.html

23 hours ago | 0

Answered

how to summary graphics

syms x f1(x) = x^2 - 4*x + 3; f2(x) = x^3 - 4*x + 3; then fplot([f1 f2], [0 4]) or fplot(f1, [0 4]) hold on fplot(f2, [0...

how to summary graphics

syms x f1(x) = x^2 - 4*x + 3; f2(x) = x^3 - 4*x + 3; then fplot([f1 f2], [0 4]) or fplot(f1, [0 4]) hold on fplot(f2, [0...

23 hours ago | 0

Answered

Polynomial to Matrix form(canonical form)

syms x1 x2 QQ = x1^2 +2*x1*x2+x2^2 factor(QQ)

Polynomial to Matrix form(canonical form)

syms x1 x2 QQ = x1^2 +2*x1*x2+x2^2 factor(QQ)

1 day ago | 0

Answered

Error: Conversion to struct from single is not possible

Data.Encode.AH.High_Theta.Phases is not a cell array. Instead it is a struct, and phases{ii,jj} is an array of double. The [] o...

Error: Conversion to struct from single is not possible

Data.Encode.AH.High_Theta.Phases is not a cell array. Instead it is a struct, and phases{ii,jj} is an array of double. The [] o...

2 days ago | 0

Answered

DICOM Image Resize Error

It is not possible to resize an entire imageDatastore. You would need to loop doing readimage() and resize them one by one, or e...

DICOM Image Resize Error

It is not possible to resize an entire imageDatastore. You would need to loop doing readimage() and resize them one by one, or e...

2 days ago | 1

| accepted

Answered

Creating plot with 2 x axes

Your ax2 is using the default background color, which is white. It is hiding the other axes.

Creating plot with 2 x axes

Your ax2 is using the default background color, which is white. It is hiding the other axes.

2 days ago | 0

Answered

audiorecorder is "not intended for long recordings". What is?

Yes, audio device reader from Audio System Toolbox is what you should be using for real time processing .

audiorecorder is "not intended for long recordings". What is?

Yes, audio device reader from Audio System Toolbox is what you should be using for real time processing .

2 days ago | 0

Answered

Conditionally Defining a Variable using ODE45

you need to use three ode45 calls , once for the three cases (before 3, during the range, after 4)

Conditionally Defining a Variable using ODE45

you need to use three ode45 calls , once for the three cases (before 3, during the range, after 4)

2 days ago | 0

Answered

How can I get outcome at a particular value after performing differentiation?

subs(diff(f,x),x,2)

How can I get outcome at a particular value after performing differentiation?

subs(diff(f,x),x,2)

2 days ago | 0

| accepted

Answered

How can I write this C++ script to Matlab?

for k = No_TimeSamples for i = No_Pixels SUM_1 = 0; SUM_2 = 0; for j = 1 : No_Geophones ...

How can I write this C++ script to Matlab?

for k = No_TimeSamples for i = No_Pixels SUM_1 = 0; SUM_2 = 0; for j = 1 : No_Geophones ...

2 days ago | 0

Answered

While loop not performing

When you use if or while with a condition, then MATLAB only considers the condition to be true if all the values being tested ar...

While loop not performing

When you use if or while with a condition, then MATLAB only considers the condition to be true if all the values being tested ar...

2 days ago | 0

| accepted

Answered

Update a Line Array in one call?

Xc = num2cell(X,1); Yc = num2cell(Y,1); Zc = num2cell(Z,1); set(AllLines, {'XData','YData','ZData'}, [Xc.', Yc.', Zc.']) set...

Update a Line Array in one call?

Xc = num2cell(X,1); Yc = num2cell(Y,1); Zc = num2cell(Z,1); set(AllLines, {'XData','YData','ZData'}, [Xc.', Yc.', Zc.']) set...

2 days ago | 0

| accepted

Answered

What is the best connection to simultaneously capture video from multiple HD cameras?

If you need tight frame synchronization then NI CompaqDaq chassis with video digitizer boards . Either software sync or chain a ...

What is the best connection to simultaneously capture video from multiple HD cameras?

If you need tight frame synchronization then NI CompaqDaq chassis with video digitizer boards . Either software sync or chain a ...

2 days ago | 0