# 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 T0099000; if you are waiting on a reply from me for an older issue, please send me a reminder.

**Programming Languages:**

C++, C, MATLAB, Shell, Perl, Fortran

**Spoken Languages:**

English

**Statistics**

RANK**1**

of 244,399

REPUTATION**116,610**

CONTRIBUTIONS

**34** Questions

**52,725** Answers

ANSWER ACCEPTANCE **
52.94%
**

VOTES RECEIVED**14,973**

RANK

of 17,075

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**

How to insert variables (string) in MATLAB function

rotmatx('y', 'p') rotmatx('z', pi/6) function R=rotmatx(axis,q) Q = sym(q); if axis=='x' R=[1 0 0;0 c...

2 hours ago | 1

| accepted

for文とif 文

rng(1,'philox') X = randi([0 1], 3, 3, 100); a = tril(ones(3), -1) == 1; a = repmat(a, 1, 1, 100); X(a) = 0; X = X + permut...

15 hours ago | 0

| accepted

How to avoid duplication of random numbers?

node_sequence = randperm(n, t-reply_timer); Now use the elements of node_sequence, in that order. You will quickly get an erro...

15 hours ago | 0

Vpa Solve solving for B

M1 = 3; P1 = 1; theta2 = 15; thetha3 = 20; gamma = 1.4; syms beta tantheta = tand(theta2); x = 2*cotd(beta)*((M1^2*...

20 hours ago | 0

| accepted

Can I use the MEX function and compiler with a student license?

mex() is part of basic MATLAB. It relies upon third-party compilers to generate binary code from C or C++ (or fortran) code that...

23 hours ago | 0

Extract first non-NaN of each row without loop

A=[NaN,444,NaN,NaN,41; NaN,NaN,NaN,222,NaN; NaN,NaN,554,554,NaN; 125,747,21,NaN,4; NaN,NaN,NaN,43,NaN; ...

23 hours ago | 0

| accepted

Plot not updating even after changing plot data

You are not plotting into the axes you think you are plotting into. https://www.mathworks.com/matlabcentral/answers/22208-show-...

23 hours ago | 0

having trouble writing a code that produce this graph.

Hint: plot([-3 0 0], [0 0 -4]); xlim([-5 5]); ylim([-5 5])

23 hours ago | 0

Displaying values of x, ode45 and real y in a fprintf command

Yes and no. Yes, you can include an fprintf() statement inside your ode function, and that fprintf() statement will display wha...

2 days ago | 0

| accepted

Find Command not working.

T = [NaN 0.1:0.1:0.9] a = 0.3; Visually, it looks like 0.3 is in T find(T == a) But find() says it is not there. Is it the...

2 days ago | 0

Sum of previous 5 numbers

A=[2 3 4 5 6 7 8 9 10 8 5]; B=[0 2 5 9 14 20 25 30 35 40 42 ]; N = 5; C = movsum([0 A(1:end-1)], [(N-1) 0]) isequal(C, B)

2 days ago | 0

| accepted

lla2ecef is not supported for code generation

https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/7942/versions/1/previews/lla2ecef.m/index.html

2 days ago | 0

| accepted

how to make Cubesat fixed

You need a geosynchronous orbit, which is about 42164 km from the centre of the Earth. (Careful, orbits are also often specified...

2 days ago | 0

How can we know whether the current execution of command is conducting inside a function or not?

The functions nargin and nargout will error if executed at the base. So you can use try/catch inbase = false; try; nargin; cat...

3 days ago | 0

| accepted

My codes won't show in the plots.

for i =0:n; vo1 = readVoltage(A,'A0'); vo2 = readVoltage(A,'A1'); vo3 = readVoltage(A,'A2'); end Every time thr...

3 days ago | 0

| accepted

If I upload a MATLAB video to YouTube, I wonder if there are any legal issues.

Academic licenses may be used for the education purposes and internal purposes of the university, including non-commercial resea...

3 days ago | 0

Avoid overlapping of node labels in graph

Not using the plot() call. Changing the layout might help https://www.mathworks.com/help/matlab/ref/matlab.graphics.chart.primi...

3 days ago | 0

Genetic Algorithm Plotter does not display

opts=optimoptions('ga', 'FunctionTolerance', 1E-9, 'MaxGenerations', 5000000, 'MaxStallGenerations', 500000, 'HybridFcn', 'patte...

3 days ago | 0

Defining a function for a vector of values, while keeping two variables unknown

So I must achieve the function, EV(x,i), and then replace by the values of x and i If you must achieve the function first, and ...

3 days ago | 0

| accepted

circle marker weird filling

Linewidth problems. The circle is drawn as a series of straight segments and when the Linewidth is not 1 the ends of the lines e...

3 days ago | 0

Why MATLAB cannot render $\Beta$ (LaTeX string) in xlabel, ylabel?

MATLAB's latex does not specifically support Greek. Instead, it supports some mathematical symbols, some of which happen to rese...

4 days ago | 1

how to repeat an input question

all_A = {}; while true A = input('give me a sentence!: ','s'); %asks user for sentence input if strcmpi(strtrim(A), 'en...

4 days ago | 0

How to make negative degree numbers positive while maintaining degree.

You can use logical indexing.... avg_deg = randi([-719 719], 1, 10) mask = avg_deg < 0; new_deg_version_1 = avg_deg; new_d...

4 days ago | 0

| accepted

How to plot a 3D surface with two vectors and one array?

Create full vectors of coordinates and arrayfun() x = linspace(-10, 10, 100); y = linspace(-0.5, 0.5, 100); [X, Y] = meshgrid...

4 days ago | 1

| accepted

dot product and indexing

The 1:k-1 can only work properly if k is a scalar. NRow(1:k-1) == NCol(k) That part tests whether each value in NRow before in...

4 days ago | 0

When I export the figure, the x-axis is halved even though I have set the interval in the code.

I do not observe that? I observe a possible loss of quality, but keep in mind that the image taken includes the outside of the ...

5 days ago | 0

Solving an ordinary differential equation.

Q = @(v) sym(v); h = Q(10); k = Q(60); t = Q(0.01); T0 = Q(10); T1 = Q(10); q = Q(800); syms T(x) dT = diff(T); d2T...

5 days ago | 0

| accepted

clear is solwer than writing

You might be interested in the timing tests I did at https://www.mathworks.com/matlabcentral/answers/60240-what-is-the-differenc...

5 days ago | 1

Solve a integral equation

Q = @(v) sym(v); syms t C real alpha = Q(2); sigma = Q(0.4); Pi = Q(pi); f(t) = exp(-(log(t)^2/(2*sigma^2)))/(t * sigma...

5 days ago | 0

License Server Unsupported -5 errors

Over at https://forums.developer.nvidia.com/t/no-such-feature-exists-after-updating-our-licens/135772 I find an indication that ...

5 days ago | 0

| accepted