# Walter Roberson

I do not do free private consulting. If you want to bring my attention to something, send a link to the MATLAB Answers location. I am currently caught up to T0099089; if you are waiting on a reply from me for an older issue, please send me a reminder.

**Programming Languages:**

C, MATLAB, Shell, Perl, Fortran

**Spoken Languages:**

English

**Statistics**

RANK**1**

of 247,475

REPUTATION**117,829**

CONTRIBUTIONS

**34** Questions

**53,155** Answers

ANSWER ACCEPTANCE **
52.94%
**

VOTES RECEIVED**15,186**

RANK

of 17,243

REPUTATION**N/A**

AVERAGE RATING**0.00**

CONTRIBUTIONS**0** Files

DOWNLOADS **0**

ALL TIME DOWNLOADS**0**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

setdiff not working for a particular value, bug?

not a bug. D = 1.59; vec = 1:0.005:2; [~, idx] = min(abs(vec - D)); vec(idx) vec(idx) - D You can see that the closest val...

3 hours ago | 0

| accepted

Containers.Map and struct with dynamic field names not supported in code generation

Struct array. One of the fields is the node ID, and the other is the node value. Instead of checking whether the node exists usi...

3 hours ago | 0

how to use a while loop for switch case

try_again = true; while try_again transactionType= input('1:withdraw 2:deposit 3:account balance 4:end use'); switc...

7 hours ago | 0

How to write a matlab code for a given algorithm from a given array and function?

MATLAB does not permit using () to create pairs. MATLAB does not have a "tuple" datatype. The closest equivalent for it are vec...

8 hours ago | 0

How to assign predetermined values for points of discontinuity

v = 0:5:50 a_n=(0.01.*(10-v))./(exp((10-v)./10)-1) b_n= exp(-v./80)./8 a_n(v == 10) = 0.1;

8 hours ago | 0

Matlab using parallels on M1 macbook pro

https://www.parallels.com/products/desktop/resources/ says Supported Guest Operating Systems (Mac with Apple M1 chip): ...

8 hours ago | 0

Error using fmincon. Supplied objective function must return a scalar value.

for w1 = rbf_coeff1 w2 = rbf_coeff2; That is not a dual "for" loop !! It does not simultaneously iterate through rbf_coeff...

9 hours ago | 0

How do I get the URL from an internet shortcut?

In simple cases, it is a text file that you can pull the URL= out of. However... as soon as you open it with Windows Explorer t...

9 hours ago | 0

How to use Runge Kutta method to solve state space equation

(4 by 4) * (4 by 1) --> 4 by 1 (4 by 12) * (12 by 1) --> 4 by 1 4 by 1 + 4 by 1 --> 4 x 1 So that calculation sounds plausi...

19 hours ago | 0

display table in command window without { }

No, it is not. However, if you only need that for display purposes, then tt = table({1;2;3;4;5},{'A';'B';'C';'D';''},{9;10;11...

20 hours ago | 0

How to get fzero with 2 variables in array?

I'm trying to solve fzero for each value of x in an array, and I get theis error: Don't Do That. fzero() is defined as only ac...

21 hours ago | 0

Eliminate a component of an equation

V=1/3*pi.*power(r,2)*h;%m^3 If V = something*h then it follows that h = V/something B=sqrt((r^2)+(h^2)); And that definition ...

21 hours ago | 0

how to fix invalid setting for fixed-step size in matlab?

You configured the Simulink solver as being a fixed-step algorithm instead as being variable-step. When you do that, then you ca...

21 hours ago | 0

How to get fzero to work on an array?

I'm trying to solve fzero for each value of x in an array, and I get theis error: Don't Do That. fzero() is defined as only ac...

21 hours ago | 0

How can I plot the graph of three non-linear coupled ODE's vs. time in xy-plane in MATLAB. I want to use x-axis for time while y axis for x(1),x(2),x(3) thanks

tspan = [0 10]; x0 = [0 0.1 0.2]; [t, x] = ode45(@odefun, tspan, x0); plot(t, x); legend({'x(1)', 'x(2)', 'x(3)'}, 'locati...

22 hours ago | 1

| accepted

I have a question: Objective function is undefined at initial point.

You have function loglt = lnlt( b,yy) and a0=b(1:2); a1=b(3:4); b1=b(5:6); c1=b(7:8); pp=b(9:10); w...

1 day ago | 0

extract/access same fields from multiple structures (it is a nested structure)

temp = [S1; S2; S3; S4; S5; S6; S7; S8; S9]; all_TKE = [temp.TKE]; The above would only work if the structures all have the sa...

1 day ago | 1

| accepted

Are there Any Restrictions on Latex Markup in Figure Titles?

The \text is the immediate problem. If you use \textrm instead then you get something

1 day ago | 0

| accepted

plot system of 5 odes over time using ode45

tspan = [0 0.184]; xinit = [10000, 0, 0.01, 0, 0]; [t, y] = ode45(@odefun, tspan, xinit); plot(t, y); legend({'T', 'Q', 'V...

1 day ago | 2

Create and dynamically change a continuous tone with user input in MATLAB

See https://www.mathworks.com/help/audio/gs/audio-io-buffering-latency-and-throughput.html In particular, you cannot change t...

1 day ago | 1

| accepted

<SOS> Unrecognized function or variable 'setOccupancy'.

It needs the Robotic System Toolbox, R2015a or later. That is the same software and release that introduced binaryOccupancyMap,...

1 day ago | 0

FUNCTION shift of vector's position

Take a copy of what is about to be overwriten. Use array subscripts to move the old data to the new positions. For example A(:...

2 days ago | 0

how to create an input window for more than two variables

prompt = {'r1','r2','r3','r4','o2','o2p','o2pp'}; Note that the collected response will be a cell array of character vectors; y...

2 days ago | 1

| accepted

How to format scientific notation to have the same power?

table() objects do not support that customization. You would need to switch the items to text

2 days ago | 1

Error with ODE solver for Van der pol equation

Your function receives Y but never uses it, and needs x but does not have a source for x. The simplest fix would be to change...

3 days ago | 1

| accepted

FFT, Inadequate Frequency precision

You need a longer signal to get that resolution. Twice as many points would get you to 10.275 and you would need more than that ...

3 days ago | 0

| accepted

Plot in MATLAB app desinger not working

plot() only draws lines if you supply at least two adjacent finite coordinates in a single call. However you are passing in scal...

3 days ago | 0

creating while loop for two different variable

while delta_a > epsilon || delta_a_prime > epsilon

3 days ago | 0

Error on a single numeric equation

heaviside not heavyside heaviside will not convert that table of conditions into appropriate heaviside calls. You can write y...

3 days ago | 0

Meaning of a code line

! is going to invoke an operating system command. The operating system copy command will be invoked. We can tell by the ..\ t...

3 days ago | 0

| accepted