Community Profile

photo

Walter Roberson


Last seen: Today
50,683 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
BAD REFERENCE SIGNALS ERROR IN TDOA
It looks like you are using a system that has three signals total, two of which are intended to be the same reference signal, an...

4 hours ago | 0

Answered
How can I fix the error "Subscript indices must either be real positive integers or logicals. "
u1(1i)=-((Beta(1i)+10)*abs(x(1))+2*abs(x(2))+s1(1i)+z1(1i))*sign(S(1)); Beta(1i) is an attempt to index which does not exist. ...

10 hours ago | 0

Answered
Error using == (line 30) Invalid types for comparison?
rxTestLabels = categorical(gather(testLabelsTall));

11 hours ago | 0

Answered
How can I fix the error "Subscript indices must either be real positive integers or logicals."
d1=0.15*sin(5*t(1i)); t(1i) is an attempt to index MATLAB has absolutely no implied multiplication -- it does not even have ...

11 hours ago | 0

Answered
alternative to interpolation, how to introduce randomness
d = rand(3600, length(flux_per_hour)); rd = d./sum(d,1); flux_per_second = flux_per_hour(:).' .* rd; %seconds down, hours ...

11 hours ago | 0

Answered
integral calculus question of two variables.
syms x y int(3*x + y * x^2, x, 2, 3)

11 hours ago | 0

Answered
how do I average each 10 elements of a matrix?
mean10 = mean(reshape(Vector, 10, []),1)

12 hours ago | 0

| accepted

Answered
get user input in the form of an integer
You can use inputdlg() to request multiple boxes, and then str2double() the resulting cell array. You can use input() and assum...

12 hours ago | 0

Answered
I can't seem to generate a Morse code output on my edit2 static text in my GUI, is there something wrong with my code? We're supposed to create a GUI which converts Letter/Numbers into Morse code..
x = char(get(handles.edit1_num,'String')); Okay, x is what the user input. for i=1:length(x) You want to proceed through the ...

12 hours ago | 0

Answered
Integrating cell2mat array
function ECC = energy_consumption(ECC_1,ECC_2) syms tt ECC_1t = ECC_1.*tt; ECC_2t = ECC_2.*tt; ECC11 = int(ECC_1t, tt...

13 hours ago | 0

| accepted

Answered
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
import numpy as np MATLAB does have an import statement, but it only accepts a single name after it; it does not support using ...

13 hours ago | 0

Answered
How to add an eguation into my plot?
You can text() a label into position, and you can set the Interpreter property of the text() object to 'latex'

13 hours ago | 0

Answered
How to plot double series with one parameter?
Look at the denominator of your inner summation. It has . But if n = 2*p then that would be p^2 - (2*p)^2/4 -> p^2 - 4*p^2/4 -...

14 hours ago | 0

Answered
Need help solving equation in terms of a variable
syms L k Lk2 eq8 = cos((L*k)/2)*cos((2^(1/2)*L*k)/4) - (2^(1/2)*sin((L*k)/2)*sin((2^(1/2)*L*k)/4))/2 == 0 K = solve(k*L/2 == L...

15 hours ago | 1

Answered
How to go about programming this function in MatLab
c = @(x,y) sum(sqrt((a-x).^2 + (b-y).^2))

22 hours ago | 0

Answered
How to call a function in a nested parfor loop?
m = 5; n = 7; xx = randn(m,n); yy = randn(m,n); output = zeros(m,n); parfor i=1:m xi = xx(i,:); yi = yy(i,:); ...

23 hours ago | 1

| accepted

Answered
Initial Value of x(0)=16
Offset = 1; x(0+Offset)= 16 %( how can I make this work????) a=16; N=500; for k=1:N x(k+Offset)= (1/2.*((x(k-1+Offset))...

24 hours ago | 0

| accepted

Answered
Change names of multiple pictures inside a file
a ='C:\Users\nas\Desktop\0.3'; A = dir( fullfile(a, '*.jpg') ); fileNames = fullfile({A.folder}, {A.name}); for iFile = 1 :...

24 hours ago | 1

| accepted

Answered
Error converting Logical to Char (Horzcat Error)
It is a bug in some versions of Audio System Toolbox. In later versions the line if isscalar([varargin{:}]) has been repla...

1 day ago | 0

Answered
Translation of a plot line
The easiest way is to find the line handle, extract the YData, add the shift to it, and store the result back in the YData prope...

1 day ago | 0

| accepted

Answered
Read 100 different digital files one by one
Do not use [] to splice together filenames. Use fullfile() instead. For example, input_video_filename = [dir_input, 'D:\RA\Ste...

1 day ago | 0

Answered
Matrix Fill with same number sequence
YourMatrix(1:6,1:2:end) = 20; YourMatrix(1:6,2:2:end) = 30;

1 day ago | 0

| accepted

Answered
matlab optimisation problem _ constraint
A problem is being constructed. It has constraints. One constraint is named energyBalance . The first line, optimconstr(N) say...

1 day ago | 0

Answered
How to extract data between start and end points of flood as separate events?
ev = arrayfun(@(sp, ep) peakpoints(sp:ep), start_points, end_points, 'uniform', 0);

1 day ago | 0

Answered
Plot dashed lines to given y value on a graph
x = [0:1:25]; y = x * pi ; stem(x,y, '--')

1 day ago | 0

| accepted

Answered
Any limitation to FFT calculation for large sampled signals
Example below with 5e7 (50,000,000) points -- 1000 times more than you were asking for. The number you are asking for is no prob...

1 day ago | 1

| accepted

Answered
How to read specific lines from a text file and store them in a matrix?
t = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/589822/20200926T000414.txt'); t(1:5,:)

1 day ago | 0

| accepted

Answered
tan(x) graph
syms x fplot(sin(x)^2,[0 2*pi])

1 day ago | 0

Answered
How to derive a three variables function from a data
Yes. See for example the Curve-Fitting Toolbox. You might also be able to take advantage of cftool You will need to know the fo...

1 day ago | 0

Answered
How to solve a cubic equation using Genetic Algorithms?
f = @(x) x.^4-2*x.^3+3*x.^2+x-4 target = 5; residue = @(x) (f(x)-target).^2 [bestx, fval] = ga(residue, 1) roots([1, -2, 3, ...

1 day ago | 0

Load more