Community Profile # Walter Roberson

Last seen: Today Active 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. 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

All
• • • • • • • • • • • • #### Content Feed

View by

Is this combination of parfor and global variables prone to errors?
That should work, as long as the principal function sets the global variables on every call, or at least tests whether they alre...

ungefär 2 timmar ago | 0

| accepted

The beginning of my graph is getting the wrong values. values for x=20,25 and 30 are correct. can someone help?
x=0:5:30; y = (110) .* x ./ (5+x) .* exp((-0.8*x)/8); plot(x,y)

ungefär 10 timmar ago | 0

use cell items in the conv
conv() will never be able to process cell arrays . You need to use ab = conv(a{u,1}, b{v,})

ungefär 12 timmar ago | 0

How would I put this into a graph?
syms x y = randi(256) ./ (x ./ randi(10) + x) .* exp(-rand() .* x ./ randi(10)) fplot(y)

ungefär 13 timmar ago | 0

Array indices must be positive integers or logical values.
t = linspace(0,2,1000); t is a (real) vector of length 1000 if t(1i) <= 1 That asks to index the vector t at location 1i...

ungefär 13 timmar ago | 1

How to find the common dates between two different variables that are not the same size or format?
dtdt = datetime(dt, 'ConvertFrom', 'datenum', 'Format', 'dd-MMM-yyyy HH'); dtday = dateshift(dtdt, 'start', 'day'); %change...

ungefär 14 timmar ago | 0

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

ungefär 15 timmar 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...

en dag 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...

en dag 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*...

en dag 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...

en dag 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; ...

en dag 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-...

en dag 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])

en dag 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 dagar 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 dagar 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 dagar ago | 0

| accepted

lla2ecef is not supported for code generation

3 dagar 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...

3 dagar 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 dagar ago | 0

| accepted

My codes won't show in the plots.

3 dagar 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 dagar 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...

4 dagar ago | 0

Genetic Algorithm Plotter does not display
opts=optimoptions('ga', 'FunctionTolerance', 1E-9, 'MaxGenerations', 5000000, 'MaxStallGenerations', 500000, 'HybridFcn', 'patte...

4 dagar 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 ...

4 dagar 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...

4 dagar 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 dagar 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 dagar 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 dagar ago | 0

| accepted