Community Profile

photo

Walter Roberson


43,327 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 2018
  • Most Accepted 2017
  • 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
  • First Answer
  • Solver

View details...

Contributions in
View by

Answered
generate odd and even numbers from randn function in simulink
https://www.mathworks.com/help/dsp/ref/convert1dto2d.html -- reshape the vector to two rows https://www.mathworks.com/help/dsp/...

23 hours ago | 0

Answered
How would I create a script to read files line-by-line to save memory
vary_every = 10000; expected_buffers = 10000; %1000000000 / 100000 group_every = 360; variances = zeros(1, expected_buffers...

1 day ago | 0

Answered
Translating sigma notation / summation / series and integral equation from Microsoft Word into MATLAB syntax and graphing / plotting
syms n t Q = @(v) sym(v); %convert to rational Pi = sym('pi'); f1 = Q(0.111627907); f2a = int((Q(-0.3072*10^(-5))*(t ...

1 day ago | 2

Answered
Why can't 32-bit values be converted to 24-bit values?
MATLAB does not have any 24 bit data type. typecast() is only for taking a block of memory and changing the interpretation of ...

1 day ago | 1

| accepted

Answered
sfit decimals output only 4 sig figs
coeffs = coefvalues(Your_sfit_object); num2str(coeffs, '%.15g')

1 day ago | 1

| accepted

Answered
Do I need Matlab Runtime to run a 3rd-party application if I have Matlab standalone?
The application requires a runtime (MCR) that exactly matches the version it was compiled with. Also, MCR.exe is responsible f...

1 day ago | 0

| accepted

Answered
How to close .m script file in GUI with a push button?
allEditors = matlab.desktop.editor.getAll; Now match the filename you want to close against {allEditors.Filename} to figure out...

2 days ago | 0

| accepted

Answered
Read Date time series format
S = fileread('update_engine.txt'); timestamps = regexp(S, '^.(.{18})', 'lineanchors', 'match'); ts_dt = datetime(timestamps, '...

2 days ago | 0

Answered
Error in audio uploading time.
You need to tell audiowriter that the sample rate, FS, is 8000.

3 days ago | 0

Answered
How to plot a series of numbers which some of them are inf?
plot(X, min(Y, ValueYouWantPlottedInsteadOfInf))

3 days ago | 0

Answered
optimization error ,when i used fmincon for three variables,getting same intial guess value in result
function [fval]=weight_testvariable(X) [...] X=[0.001;0.006;0.4]; You are ignoring the input and always calculating the same ...

3 days ago | 0

| accepted

Answered
How select a first value from the binary matrix ?
[~,idx] = max(matrix); output = sparse(idx,1:size(matrix,2),1,size(matrix,1),size(matrix,2)); Note: in the case where there ar...

3 days ago | 1

Answered
Unique not working - may be due to different datatypes in array
Those are not different datatypes. When you see the same array displaying 7.00000000000000 and 7 both, then what it tells you ...

3 days ago | 1

| accepted

Answered
how can call a function
Example: N = 100; o = zeros(N,1); a = zeros(N,1); b = zeros(N,1); c = zeros(N,1); d = zeros(N,1); for idx = 1 : N X = ra...

3 days ago | 0

Answered
how to use QPBLUR in Matlab?
QPBLUR appears to have been implemented as part of SNOPT which you would obtain a license for from http://ccom.ucsd.edu/~optimiz...

3 days ago | 0

Answered
"Index exceeds matrix dimensions."
Ztramo is an fi by co by noZ matrix. inv(Ztramo(:,:,i)) is a fi by co matrix if it works at all, which can only happen if fi an...

3 days ago | 0

| accepted

Answered
plotting multiple surfaces out of a 3d variable
Look in the File Exchange for "vol3d v2" Or perhaps you should just use slice https://www.mathworks.com/help/matlab/ref/slice.h...

4 days ago | 0

| accepted

Answered
Is there a way to continue operation during input()?
https://www.mathworks.com/matlabcentral/fileexchange/8297-getkeywait The below two mostly rely on Psychtoolbox https://ww...

4 days ago | 0

Answered
How to set constraints of griddata results are all non-negative?
The griddata and interp1 and interp2 methods that do interpolation (so everything except nearest or next or prev) are all subjec...

4 days ago | 0

Answered
Store function in an array
A = @(c) 3.*c +1; B= @(c) [A(c) A(c) A(c);... A(c) A(c) A(c);... A(c) A(c) A(c)]; C= @(c) det(B(c)); D= f...

4 days ago | 0

| accepted

Answered
Why do I not get the whole domain plotted?
You do not get a plot up to 20E9 because your calculation overflows to infinity. The below does not overflow to infinity, but i...

4 days ago | 1

| accepted

Answered
How can I set the colors in the legend if I show a number of legend elements which is lower thatn the number of plotted functions?
The trick for custom legends is to use for k = 1:num2show bh(k) = bar(nan, 'color', BarColors(k, :) ; end legend...

5 days ago | 0

Answered
ode for different time intervals
It is valid to test if t < stoptime1 inside an ode function. However, you need to make two calls to ode45 [t1, y1] ...

5 days ago | 1

| accepted

Answered
Cpu usage in parrallel running mode
Have a look at the attached modified version of your code and see if it does what you want. I am not confident that my changes m...

5 days ago | 0

| accepted

Answered
index exceeds the number of array elements error
Looking at your code, I speculate that a is datatype uint8() When you have a/B with a uint8 divided by a double or another uin...

5 days ago | 0

| accepted

Answered
How to use textscan on a cell array without a loop?
See my answer at https://www.mathworks.com/matlabcentral/answers/476452-splitting-one-column-into-multiple-columns# on how to pr...

5 days ago | 0

Answered
how do i re-run a script so that it takes the updated information from another script?
MATLAB will normally notice changes to .m files that are on the current path, but not if they are installed under the MATLAB ins...

5 days ago | 0

Answered
How do I get subs to behave as desired for symbolic expressions ... does collect change an expression?
collect(f,x) is a different expression with a different internal symbol than f is. isAlways(f==collect(f,x)) It is tempting to...

5 days ago | 0

Answered
Splitting one column into multiple columns
input = {'0.17 1.7285 0.001763792 1.000977 56651.41 0.000017652 DHT11, OK, 35.0,'; ...

5 days ago | 1

Answered
How to find first row with a nonzero element in an image matrix?
find(any(any(YourImage, 3),2),1,'first')

5 days ago | 0

| accepted

Load more