Community Profile

photo

Walter Roberson


Last seen: Today
47,196 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.

Contact

Walter Roberson's Badges

  • Most Accepted 2019
  • Most Accepted 2018
  • Most Accepted 2017
  • Solver
  • First Review
  • 36 Month Streak
  • Most Accepted 2016
  • Most Accepted 2015
  • Most Accepted 2011
  • Most Accepted 2012
  • Most Accepted 2013
  • Thankful Level 4
  • Grand Master
  • Revival Level 4
  • Knowledgeable Level 4

View all

Contributions in
View by

Answered
Help with FOR to PARFOR conversion
Every iteration you overwrite all of D. Your result is whatever was assigned in the last iteration. But the order of iterations ...

15 hours ago | 0

Answered
Error using sym/subsindex
symbolic variables can never be used as indices. You cannot symsum or symprod and use the control variable as an index. Inste...

15 hours ago | 0

Answered
Make a point move up and down
x = 0:.01:20; %linspace of x y = sin(x); %wave equation px = 0; %initial x plot py = 0; %initial y plot img =imread('AvgBsc...

16 hours ago | 0

| accepted

Answered
How to generate random numbers with constraints and different boundaries (for a high dimension)?
https://www.mathworks.com/matlabcentral/fileexchange/9700-random-vectors-with-fixed-sum Roger has programmed exactly that.

17 hours ago | 0

Answered
if statement not displaying
if (n) >= (3) You are entering 3 ingredients, so n >= 3 is true, so the body of the "if" will be executed. elseif (a(k)) == (1...

17 hours ago | 0

| accepted

Answered
Why is memory reduced for an identical copy of a sparse array?
The operation AAAAAAA(1:end,1:end) is not the same as AAAAAAA by itself. >> V=[1 -2 3 -4 5] V = 1 -2 3 -4 ...

17 hours ago | 0

Answered
Data Acquisition Toolbox with Simulink: Counter Input Channel
turn off rapid acceleration. You can have normal acceleration but you will probably need to mark a number of functions as exte...

1 day ago | 0

Answered
Can I programmatically do file I/O on AWS EFS or EB3?
https://www.mathworks.com/help/matlab/release-notes.html R2020a copyfile() supports aws s3: URI.

1 day ago | 0

| accepted

Answered
Error with Measure Distances in an Image
images.roi.Line needs at least R2018b I believe.

1 day ago | 0

| accepted

Answered
How to solve exponential equation ?
The empty answer is correct. When you solve(), you are asking for the set of values for variables that makes all of the equatio...

1 day ago | 0

Answered
Readtable reads my timestamp data as NaN
filename = 'heart.csv'; S = fileread(filename); datacell = textscan(regexprep(S, ':(\d\d\d)', '.$1'), '%f%T%f%f%f%T%f%T', 'hea...

1 day ago | 0

| accepted

Answered
using interp1 'nearest' and 1 value is missing
nearest= interp1(refDateTime, 1:length(refDateTime),expDateTime, 'nearest', 'extrap') The interpolation mode you were using, li...

1 day ago | 0

| accepted

Answered
cannot save quadrature data
file_name ='data.txt'; fid = fopen(file_name, 'w'); fprintf(fid, '%.17e%+.17ei\r\n', [real(data.'); imag(data.')]); fclose(fi...

1 day ago | 0

| accepted

Answered
Help with solve under the symbolic environment
%Calibration p0 = 0.05; p1 = 0.1; lambda = 0.1; ybar = 1; kappa = 0.9; b0 = 0.5; c1 = 0.4; alpha = (ybar*lambda*(1-p0)/p...

1 day ago | 0

| accepted

Answered
Searching for specific pattern and returning 16 values/data characters from the last index of occurrence of my specific pattern
input1 = [0 0 0 0 0 1 0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 1 0 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ]; substring=[0 1 0 1]...

1 day ago | 0

Answered
About copying txt to matrix
filename = 'whatever.txt'; fid = fopen(filename, 'rt'); data = cell2mat( textscan(fid, '%f%f%*s') ); fclose(fid);

2 days ago | 0

| accepted

Answered
"str2sym" delete the element wise operation
This is correct behaviour for symbolic expressions. The symbolic toolbox assumes that any unresolved symbolic variable name w...

2 days ago | 1

Answered
animatedline fails after the first iteration
Create the subplot and modify their position before the loop. Make sure to pass the axes to the hold() and grid() calls. At p...

2 days ago | 1

| accepted

Answered
How to associate a rectangle with a struct?
rgb = imread(filename) ; mask = rgb(:, 1) < 32 & rgb(:, 2) > 224 & rgb(:, 3) > 224; mask = bwareafilt(mask, [50 inf]); ...

2 days ago | 0

| accepted

Answered
Conversion to double from struct is not possible.
Filenames = dir('*mat'); numfiles1 = length(Filenames); EEGSinDC = cell(numfiles1, 1); for i = 1 : numfiles1 filedata = l...

2 days ago | 0

Answered
Yaxis becomes periodic after using ylim
I predict that you have either used yyaxis or xxaxis, or else that you have use the older plotyy(), or else that you called axes...

2 days ago | 1

| accepted

Answered
extract numbers or string after specific symbol from a text file
dinfo = dir('*.txt'); nfiles = length(dinfo); filenames = fullfile({dinfo.folder}, {dinfo.name}); IDs = cell(nfiles,1); FC...

2 days ago | 0

Answered
Imwrite creates 8bit tif file despite 16bit input
https://www.mathworks.com/help/matlab/ref/imwrite.html If A is a grayscale or RGB color image of data type double or single, t...

2 days ago | 0

Answered
About the install and configuration GPU for matlab 2020a
https://www.nvidia.com/Download/index.aspx Use that to download the appropriate driver for your system. You can download the ...

2 days ago | 1

Answered
Expression representation in an Iteration
W_k = cell(N,1); w=[randn(2,1)+ij*randn(2,1)]; W_k{1} = w*ctranspose(w); for n=1:N; w = randn(2,1)+ij*randn(2,1); W...

2 days ago | 0

| accepted

Answered
piecewise for use in anonymous functions
Rmaxtb00 = matlabFunction(Rmaxtb0, 'File', 'Rmaxtb00.m', 'optimize', false); The generated function in the .m file will use if/...

3 days ago | 1

Answered
Transfer Function with one 1/s term
You cannot do that with Control System Toolbox tf() function. tf() keeps numeric vectors of coefficients with implied powers; it...

3 days ago | 1

Answered
If expression to check whether a particular function has been called
In the general case, there is no way to detect whether a particular function has been called. If you turn on profiling before y...

3 days ago | 1

| accepted

Answered
I'm new to matlab and am trying to sort an array in ascending order without using the sort command. How would I rectify this?
You have for i=1:length(a) so i can be equal to length(a) . Then you do if a(i)>a(i+1) When i has become length(a) t...

3 days ago | 1

Answered
How to edit colors for the line?
We do not know exactly what PlotCone does, but we can predict from the observed behavior that it is creating more than one line(...

3 days ago | 0

| accepted

Load more