Answered

Using an anonymous function handle as input into another function handle

Your premise is incorrect. The below example shows that it is valid to pass function handles between multiple levels omega = @(...

Using an anonymous function handle as input into another function handle

Your premise is incorrect. The below example shows that it is valid to pass function handles between multiple levels omega = @(...

4 dagar ago | 0

Answered

use the 'patch' function with different results (using different matrices)

In your first patch() call you ask for 'k' -- black -- for the faces. The edge colors default to black as well. In the second p...

use the 'patch' function with different results (using different matrices)

In your first patch() call you ask for 'k' -- black -- for the faces. The edge colors default to black as well. In the second p...

4 dagar ago | 0

Answered

How to test if equation in .p file is linear.

In some cases you might get lucky, in that if you pass purely symbolic variables to the function, you might get back a formula. ...

How to test if equation in .p file is linear.

In some cases you might get lucky, in that if you pass purely symbolic variables to the function, you might get back a formula. ...

4 dagar ago | 1

Answered

Isosurface plots appear 2d when used with subplot

MATLAB has divides graphics calls into "high level" and "low level". "High level" calls check whether hold is on, and if not...

Isosurface plots appear 2d when used with subplot

MATLAB has divides graphics calls into "high level" and "low level". "High level" calls check whether hold is on, and if not...

4 dagar ago | 1

Answered

Problems with savepath in R2023b

On a shared system, users should not have write access to pathdef.m inside the MATLAB installation directory. If this is not a ...

Problems with savepath in R2023b

On a shared system, users should not have write access to pathdef.m inside the MATLAB installation directory. If this is not a ...

5 dagar ago | 1

Answered

I'm trying to make a for loop that has if statments that use the increments from my i to run them. How can I make this work, it won't run.

if i==0:99 The right-hand side of that == is a vector containing [0, 1, 2, 3, ... 99] The == is comparing the current valu...

I'm trying to make a for loop that has if statments that use the increments from my i to run them. How can I make this work, it won't run.

if i==0:99 The right-hand side of that == is a vector containing [0, 1, 2, 3, ... 99] The == is comparing the current valu...

5 dagar ago | 0

Answered

Using lsqnonlin and getting the message Error line 218.

clear all; clc; close all L=[3,3,3]; %starting point of electrode's position LEb=zeros(1,1); for xa...

Using lsqnonlin and getting the message Error line 218.

clear all; clc; close all L=[3,3,3]; %starting point of electrode's position LEb=zeros(1,1); for xa...

5 dagar ago | 0

Answered

Algorithm 1. Set time step (increment) 2. set max number of time steps 3. start with ground values of temperature at x=0, y=0, z=0, theta=0, and a particular value of fi 4. co

Remember that comments extend to the end of the physical line, not to the next semi-colon, so your comment about "Initialize var...

Algorithm 1. Set time step (increment) 2. set max number of time steps 3. start with ground values of temperature at x=0, y=0, z=0, theta=0, and a particular value of fi 4. co

Remember that comments extend to the end of the physical line, not to the next semi-colon, so your comment about "Initialize var...

5 dagar ago | 0

Answered

How do I use single precision numbers in a summation? My result is not coming out as expected.

You are not doing repeated addition. Repeated addition is not the same as multiplication. Also, a and b are scalar, so a*b is a...

How do I use single precision numbers in a summation? My result is not coming out as expected.

You are not doing repeated addition. Repeated addition is not the same as multiplication. Also, a and b are scalar, so a*b is a...

5 dagar ago | 0

| accepted

Answered

I can not run my function file for zohplot

When you attempt to run a function by pressing the green Run button, MATLAB never, I repeat never searches the calling environme...

I can not run my function file for zohplot

When you attempt to run a function by pressing the green Run button, MATLAB never, I repeat never searches the calling environme...

5 dagar ago | 0

| accepted

Answered

How to Find Duplicate Entries and give popup message in the 50 different Edit Field in MATLAB App Designer ?

[groupnum, group_content] = findgroups(app.YourGUITable.Data.Period); if numel(groupnum) == height(app.YourGUITTable.Data) ...

How to Find Duplicate Entries and give popup message in the 50 different Edit Field in MATLAB App Designer ?

[groupnum, group_content] = findgroups(app.YourGUITable.Data.Period); if numel(groupnum) == height(app.YourGUITTable.Data) ...

5 dagar ago | 0

Answered

Number of values stored are more than the ratio of stop Time/Step size ?

See https://www.mathworks.com/help/simulink/ug/choose-a-solver.html and https://www.mathworks.com/help/simulink/ug/managing-samp...

Number of values stored are more than the ratio of stop Time/Step size ?

See https://www.mathworks.com/help/simulink/ug/choose-a-solver.html and https://www.mathworks.com/help/simulink/ug/managing-samp...

6 dagar ago | 1

Answered

Error 2, 753 when trying to activate key

First off: if you were installing the license server facilities, then the resulting MATLAB would not need to be activated -- bec...

Error 2, 753 when trying to activate key

First off: if you were installing the license server facilities, then the resulting MATLAB would not need to be activated -- bec...

6 dagar ago | 0

Answered

error to assign string in field struct's

Compare: Sis(73).Slipp = 'example'; [Sis.SlippSource] = testfun(); function output = testfun() output = 123; end

error to assign string in field struct's

Compare: Sis(73).Slipp = 'example'; [Sis.SlippSource] = testfun(); function output = testfun() output = 123; end

6 dagar ago | 1

| accepted

Answered

Licence manager changes / Activate and manage devices

Notice that the "Option" field is "Total HeadCount". The implication is that the license is not an individual license -- the "Ma...

Licence manager changes / Activate and manage devices

Notice that the "Option" field is "Total HeadCount". The implication is that the license is not an individual license -- the "Ma...

6 dagar ago | 0

Answered

ascribe zeros to an array

frequencies = linspace(0, 2400, 250); spectrum = rand(size(frequencies)); subplot(2,1,1); plot(frequencies, spectrum); title...

ascribe zeros to an array

frequencies = linspace(0, 2400, 250); spectrum = rand(size(frequencies)); subplot(2,1,1); plot(frequencies, spectrum); title...

6 dagar ago | 0

Answered

How can I resolve the error in output for a WSN simulation in MATLAB

endToEndDelay = endToEndDelay + (t - transmissionTimes(node)); You never reset endToEndDelay, so it becomes unclear...

How can I resolve the error in output for a WSN simulation in MATLAB

endToEndDelay = endToEndDelay + (t - transmissionTimes(node)); You never reset endToEndDelay, so it becomes unclear...

7 dagar ago | 0

| accepted

Answered

how to use vpasolve to solve the equation sin(x)==0 in the range of (0,5] instead of [0,5]?

vpasolve() does not support open or semi-open intervals. The trick is to use syms x sol = vpasolve(sin(x)==0, x, [1e-63 5]) ...

how to use vpasolve to solve the equation sin(x)==0 in the range of (0,5] instead of [0,5]?

vpasolve() does not support open or semi-open intervals. The trick is to use syms x sol = vpasolve(sin(x)==0, x, [1e-63 5]) ...

7 dagar ago | 0

Answered

Subs returns empty sym n-by-0

subs(expr,sol) If sol is a struct output of solve() with returnparameters but there were no auxiliary variables introduced ...

Subs returns empty sym n-by-0

subs(expr,sol) If sol is a struct output of solve() with returnparameters but there were no auxiliary variables introduced ...

7 dagar ago | 0

Answered

Iterate through a matrix to find specific entry

Reminder: length is defined as: 0 if any dimension of the array is 0 max() of the dimensions of the array otherwise You appea...

Iterate through a matrix to find specific entry

Reminder: length is defined as: 0 if any dimension of the array is 0 max() of the dimensions of the array otherwise You appea...

7 dagar ago | 0

Answered

Strange limitations on script files?

Not allowing function definitions in the middle of a script file removes ambiguity about whether code after a function definitio...

Strange limitations on script files?

Not allowing function definitions in the middle of a script file removes ambiguity about whether code after a function definitio...

7 dagar ago | 0

Answered

Why is triplequad not recommended? In my case it works better than integral3

triplequad invokes dblquad which invokes quad . Because quad() requires that the limits are finite, then dlbquad() and triplequ...

Why is triplequad not recommended? In my case it works better than integral3

triplequad invokes dblquad which invokes quad . Because quad() requires that the limits are finite, then dlbquad() and triplequ...

7 dagar ago | 0

Answered

What is a simple way to check if a collection of vectors all have the same number of elements

a = rand(3,1); b = rand(3,1); c = rand(4,1); d = rand(3,1); vecs = {a,b,c,d}; n = cellfun(@numel,vecs,'uniform',0); if...

What is a simple way to check if a collection of vectors all have the same number of elements

a = rand(3,1); b = rand(3,1); c = rand(4,1); d = rand(3,1); vecs = {a,b,c,d}; n = cellfun(@numel,vecs,'uniform',0); if...

7 dagar ago | 0

Answered

Why isn't my code iterating more than once?

r1_real=me(1,K); r2_real=me(2,K); b1_real=me(3,K); b2_real=me(4,K); Those are all scalars. x=(r1_real(1,K).^2-r2_real(1,K)....

Why isn't my code iterating more than once?

r1_real=me(1,K); r2_real=me(2,K); b1_real=me(3,K); b2_real=me(4,K); Those are all scalars. x=(r1_real(1,K).^2-r2_real(1,K)....

8 dagar ago | 0

Question

convert patch structure to graph() object?

Is there an easier / better way to convert a patch() faces / vertices structure to a graph object? %Where S is a struct with fa...

8 dagar ago | 2 answers | 0

Answered

how to set y-axis as log scale?

The best way to create that type of axes is to use the semilogy function. Alternatively, you can set the ‘YScale’ property on th...

how to set y-axis as log scale?

The best way to create that type of axes is to use the semilogy function. Alternatively, you can set the ‘YScale’ property on th...

8 dagar ago | 51

| accepted

Answered

calculate volume from iso-surface coordinates (x,y,z).

If you use boundary then it has an optional second output which is the volume. However, I would not expect boundary() to be abl...

calculate volume from iso-surface coordinates (x,y,z).

If you use boundary then it has an optional second output which is the volume. However, I would not expect boundary() to be abl...

8 dagar ago | 1

Answered

Accepting multiple values for a function. I want my function to accept multiple values for beta

U(1,[4 5]) = [ alpha-beta, beta ]; when beta is a vector, then you have a problem: you need different 5 x 5 U matrices for each...

Accepting multiple values for a function. I want my function to accept multiple values for beta

U(1,[4 5]) = [ alpha-beta, beta ]; when beta is a vector, then you have a problem: you need different 5 x 5 U matrices for each...

8 dagar ago | 0

Answered

The function textscan is problematic and has serious bug!

You coded if totalNumFigureBad == totalNumFigureGood disp('The textscan is problematic!'); end and if counterBad == cou...

The function textscan is problematic and has serious bug!

You coded if totalNumFigureBad == totalNumFigureGood disp('The textscan is problematic!'); end and if counterBad == cou...

8 dagar ago | 0

Answered

.csv using readtable doesn't make difference between the value 1 and 01

filename = "23_Time Cards_Practice 1.CSV"; opt = detectImportOptions(filename); opt = setvartype(opt, 1, 'string'); opt = ...

.csv using readtable doesn't make difference between the value 1 and 01

filename = "23_Time Cards_Practice 1.CSV"; opt = detectImportOptions(filename); opt = setvartype(opt, 1, 'string'); opt = ...

8 dagar ago | 0