Community Profile

photo

Walter Roberson


Last seen: Today
48,675 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

  • Roberson Cup
  • Most Accepted 2019
  • Most Accepted 2018
  • Solver
  • First Review
  • 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

View all

Contributions in
View by

Answered
Matlab Simulink RepMat Execution Time
persistent idx11 if isempty(idx11) idx11 = ones(1,11); end y = u(:, idx11) ;

1 hour ago | 0

Answered
Unable to filter data with a for loop and replace command
replace() is a text processing function. You cannot use it to delete numeric values. AAA = AA(AA ~= 0); or in this particular ...

3 hours ago | 0

| accepted

Answered
possible to use the terminal command in matlab script?
You can use I/O redirection. However, if you need two-way interaction then you need a pipe. There is a popen() in the File Exch...

3 hours ago | 0

Answered
Why do i get decimal on my final answer?
Give the command format long g and now ask to display the answers again.

3 hours ago | 1

Answered
Decimal places for value stored
how can i make the value of f(x), f(x+h) and f(x-h) to be only up to 4 decimal places when calculating for f2_prime? You would ...

5 hours ago | 0

Answered
Using the function command to open a .txt file
function total_mail=AllMail(filename) q = dlmread(filename) and somewhere you would need to invoke the function with a file na...

7 hours ago | 0

| accepted

Answered
when i try to run mean function
No, that error literally cannot happen with the code you posted. In your previous question, you posted an error that can only o...

7 hours ago | 0

Answered
when i tried run something from excel it shows error?
Ftrain = Data(1:990, :); Ftest = Data(991:1000, :); Note that this will return the same datatype that Data is -- if Data is a ...

7 hours ago | 1

Answered
Timestamp to Decimal day of year
d = datetime('2003-02-20 01:00:00.100') floor(days(d - dateshift(d, 'start', 'year'))) + 1 The +1 is because the start of year...

8 hours ago | 0

Answered
ploting in matlab R2017b
That outcome is correct given that integral -- if you expected a different output then what you integrate is not correct. int(d...

8 hours ago | 0

Answered
gray scale image is not showed without divide by 255
dimg5= double (img5) That converts datatype but leaves the range alone. You are working with the floating point range 0 to 255....

9 hours ago | 0

Answered
Finding the ranges where scatteredInterpolant is above threshold
scatteredInterpolant uses linear interpolation by default. The maximum possible value when you interpolate in the interior, is e...

9 hours ago | 0

Answered
Why doesn't Matlab finish the computation ?
MATLAB did complete the calculation. That was the result. It might be more clear if you use syms d3 theta1 theta2 theta4 thet...

9 hours ago | 0

Answered
Fitlm results not obtainable
https://www.mathworks.com/help/stats/fitlm.html#bt0ck7o_sep_shared-y The response variable must be a vector . Not a matrix. If...

10 hours ago | 0

Answered
How can I solve this integration Numerically?
k = rand() * 10 z = rand() * 10 gamma0 = randn() GAMMAINC = @(z, nu) 1 - igamma(nu,z) / gamma(nu); Pi = sym(pi); syms h_a ...

10 hours ago | 0

Answered
Assign numerical values to superscripts and subscripts in symbolic equations
A = sym('sigma_dot_%d_%d__%d__%d', [maxm, maxn, maxF, maxFp] ); Note that subscripts of 0 would have to be handled differen...

13 hours ago | 0

Answered
Error in computing IRF (VAR model)
https://github.com/Vermandel/VAR-toolbox/blob/master/fn_compute_IRF.m The code uses eval() which is not a good idea. Your ...

14 hours ago | 0

Answered
How to take the engineering FFT (magnitude spectrum scaled correctly) of Signal in Matlab?
The unit for the y axis of the discrete fft is the original unit *per hertz*. You need to integrate it over frequency to get the...

23 hours ago | 0

Answered
Variable ... is undefined on some execution paths
persistent T1_prev if isempty(T1_prev); T1_prev = 0; end

23 hours ago | 0

| accepted

Answered
The way to make an array using function_hundle(関数ハンドルを用いた配列の作り方)
N = 5; f = cell(N,1); for i = 1 : N f{i} = @(x) i.*x; end You cannot use () indexing to store different function handle...

1 day ago | 0

Answered
Solving nonlinear equation using lsqnonlin
When I use those values in my objective function I get good results. However, when I am trying to findout the values of those un...

1 day ago | 0

Answered
Intersection of two vector of string/char type
[a, b, c] = intersect(["a1", "a2"], ["b1", "a1"])

1 day ago | 0

| accepted

Answered
Error using optimset(@lsqnonlin) matlab 2020b
Wrong options routine for that function. You need https://www.mathworks.com/help/optim/ug/optim.problemdef.optimizationproblem.o...

1 day ago | 1

| accepted

Answered
Meaning of "#X" in output of dsolve
I have not seen that output from dsolve() before, but I confirm that it exists. If you focus in, you will see that you have sub...

1 day ago | 0

Answered
Solve equation in interval
syms x solve([diff(x^2*exp(-x)), x <= 1, x >= -1])

1 day ago | 0

Answered
Storing data in matlab matrix using loop
[K1, K2, K3] = ndgrid(2:1:20, 2:1:20, 2:1:20); M = K1 + K2 + K3; mask = M == 20; A = [K1(mask), K2(mask), K3(mask)]; size(A)...

1 day ago | 0

Answered
Not enough input arguments
You have not shown us the definition of f, g, or j, so we cannot say which of them needs more than the four input arguments you ...

1 day ago | 0

Answered
Could someone explain what the code means?
1/1^4 + 1/2^4 + 1/3^4 + 1/4^4 + 1/5^4 + 1/6^4 and keep going adding values until the number stops changing (which will happen be...

1 day ago | 0

| accepted

Answered
How to replace all newline characters in a string with a space?
strfind(strtxt, 10) will return the indices. Hint: S = "hello" S{1}(1) = 'j'

1 day ago | 0

Answered
MATLAB DOES NOT CALCULATE THE ABSOLUTE VALUE
To get anywhere useful in a few lines, we have to make the unjustified assumption that the variable i corresponds to sqrt(-1) ...

1 day ago | 0

Load more