Community Profile

# Walter Roberson

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

View all

Contributions in
View by

the histgram of G is showing a straght line in this code
DeltaR=(rand(1000,1)-0.5)*2 R1=R10*(1+DeltaR*dR) So R1 is a constant times (1+DeltaR*dR) R2=R20*(1+DeltaR*dR); so R2 is a co...

ongeveer 6 uur ago | 1

How to preserve 2-d initial conditions after passing it into ode45?
When I step through the code in ode45, x is a 7200 x 1, 1-d array. How do I ensure x remains a 2-d matrix? To do that, write yo...

ongeveer 6 uur ago | 1

| accepted

How can i use the output of function after parfor loop?
parfor ii =1:10 for jj = 1:length(DynamicAnalysis.Name) chk=1; GroupName=char(GlobalGroupDescrption(ii));...

ongeveer 7 uur ago | 0

Renaming function so that its shorter?
https://www.mathworks.com/help/matlab/math/parameterizing-functions.html

ongeveer 14 uur ago | 0

| accepted

Help with resolving out of memory
You should be preallocating the cell array Vehicle and VID as cell(nBEV,nBev} The size of the cells are 108x108, In Vehicle, ev...

ongeveer 15 uur ago | 0

| accepted

How to give the variable name of a large dataset to a table
Once you have created the table T (let it default to whatever variable names it wants for the moment), then T.Properties.Variab...

ongeveer 15 uur ago | 0

Legend doesn't show correct colors
Your code assumes that shadedErrorBar creates exactly one graphics object per call. However if you are using https://www.mathwor...

ongeveer 15 uur ago | 0

| accepted

Dimensions do not match.
thetavals = -1:0.01:1; A = [0.96058 0.82596 0.576 0.29171 0.12276 0.12276 0.29171 0.576 0.82596 0.96058]; u = sin(thetavals)...

ongeveer 15 uur ago | 0

How to change values for variables that are defined in a equation
syms a b c d syms x eqn = (a - b + 6.96*x + (6-(31*c)/1000)*x/60*1000 + 31*c/1000*d/60*1000)*0.0081 - 0.1824 -x == 0; sol = s...

ongeveer 16 uur ago | 0

| accepted

Sharing C mex variables Between Client and parallel Workers
mexMakeMemoryPersistent is the equivalent of persistent and is not the equivalent of global . If you need changes in one worker...

ongeveer 16 uur ago | 0

Read table in .txt to MATLAB

ongeveer 16 uur ago | 0

| accepted

1000 separator and decimal separator are both commas
str2double(regexprep(s, {',(?=.*,)', ','}, {'', '.'}))

ongeveer 18 uur ago | 0

| accepted

extract one of the bits in fi(), flip it, and reassemble it to produce new bin
input = '1010'; input(3) = 'a' - input(3) ... It's magic ;-) flipped = (1 - (x - '0')) + '0' flipped = 1 + '0' + '0' - x fl...

ongeveer 18 uur ago | 0

Split arrays and Apply function
event1 = [7.046, 15.66, 24.16] B = [0.53, 1.25, 2.01, 2.78, 3.51, 4.25, 4.96, 5.78, 6.55, 7.26, 7.98, 8.76, 9.54, 10.32,11.08, ...

ongeveer 18 uur ago | 0

I am unable to solve my system of equations using MATLAB, Can anyone go through the code and suggest me some?
syms x1 x2 y1 y2 z1 z2 syms d d1 d2 intersxn_angle theta1 theta2 syms x y z eqn1 = (x-x1)*(x-x2)+ (y-y1)*(y-y2)+(z-z1)*(z-z...

ongeveer 19 uur ago | 1

| accepted

How to plot a sphere using plot tool
You can construct a list of coordinates, X, Y, Z, and use plot3(X, Y, Z, '*') to cause the points to be plotted in 3 space, w...

ongeveer 19 uur ago | 0

If, ||, && statements
if Matrix(1,:)=='0'||Matrix(2,:)=='0'||Matrix(3,:)=='0'||Matrix(:,1)=='0'||Matrix(:,2)=='0'||Matrix(:,3)=='0'||(Matrix(1,3)=='0'...

ongeveer 19 uur ago | 0

| accepted

matlab unable to classify variable in parfor loop
b_t(i,i) = phi_t(2); The parfor loop control variable can only occur in one index location. Store the contents into a vecto...

1 dag ago | 0

Tic Tac Toe game
if A&&B==0 does not mean if A is 0 and B is 0, it means if A is true if B==0 do body end end MA...

1 dag ago | 0

| accepted

defining the mean of a values inside a matrix
A = randi(9, [1 6]) [A(1), A(1:end-1) + diff(A)/2, A(end)]

1 dag ago | 3

| accepted

for loop label/arguement
That looks suspiciously like an Octave message rather than a MATLAB message... x(j+1)=mu*x(j)(1-x(j)); ^^ MATLAB...

1 dag ago | 1

Keep getting the following error : Unable to convert expression containing symbolic variables into double array.
Recheck your assignments and your indexing. b = [0 -2 -1 -1]'; A = [1 0 -1 3; 0 2 1 0; -1 1 6 -1; 3 0 -1 10]; syms alpha rea...

1 dag ago | 0

While running this program I got the error "Error using mesh (line 71) Data dimensions must agree"
f=1000; s=300; theta= 45; dp=0.000005; rb=35; Rt=20; Rmj=18; Rmn=9; v1=0.4999; v2=0.05; E1=50; E2=137000; t=0:0.1:30...

1 dag ago | 0

How can I write this for Matlab?
if ismember(phrase(i), '79') result = result + 5; elseif ismember(phrase(i), ['SZ' '2':'6' '8']) result = result + 4; ...

1 dag ago | 0

speed up a for loop
Inside your inner for loop, you read three .nc files. For efficiency, you need to reduce the number of files you need. So revers...

1 dag ago | 0

| accepted

How to check entries in a Matrix diagonal by diagonal
[nrow, ncol] = size(A); count_around = @(A,R,C) sum(A(max(1,R-1:R+1):min(nrow,R-1:R+1), max(1,C-1:C+1):min(ncol,C-1:C+1))) - ...

1 dag ago | 0

How Do I Perform Decoding Morse Code Using GUI?
Hint: strsplit() the morse, and ismember into the list of codes to figure out which is being matched. morse={'.----','..---','...

2 dagen ago | 0

| accepted

How to convert from plot3 to surf?
format short g; format compact; fontSize = 18; counter= 0; counter1=0; for ky=0:1:1000 for i=0:1:89 ...

2 dagen ago | 1

Accelerometer data to obtain tremor frequency