Community Profile

photo

Walter Roberson


Last seen: Today
50 679 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
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 ...

26 minuter ago | 0

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

40 minuter ago | 0

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

42 minuter ago | 0

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...

ungefär en timme 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 ...

ungefär en timme 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...

ungefär 2 timmar ago | 0

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 ...

ungefär 2 timmar 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'

ungefär 2 timmar 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 -...

ungefär 3 timmar 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...

ungefär 4 timmar ago | 1

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

ungefär 12 timmar 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,:); ...

ungefär 12 timmar 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))...

ungefär 13 timmar 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 :...

ungefär 13 timmar 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...

ungefär 13 timmar 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...

en dag 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...

en dag ago | 0

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

en dag 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...

en dag 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);

en dag ago | 0

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

en dag 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...

en dag 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,:)

en dag ago | 0

| accepted

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

en dag 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...

en dag 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, ...

en dag ago | 0

Answered
Matrix line by line
x = [1:1:5; 6:1:10; 11:15; 16:20; 21:25; 26:30; 31:35; [36, 0, -1, nan, nan]]; nrow = size(x,1); for K = 1 : 5 spin = ra...

en dag ago | 0

| accepted

Answered
Shortest 2D path between two points avoiding defined zones
https://www.mathworks.com/help/images/ref/bwdistgeodesic.html

en dag ago | 0

Answered
Is the RAM memory limiting the output?
Is GUD limited by the RAM as well? Yes. It needs to exist in memory in order for you to be able to save it to a file. However,...

en dag ago | 0

| accepted

Answered
Transfers of given points
%some sample data for example data(:,1) = linspace(0, 11000, 500); data(:,2) = 9500 .* exp(-0.00048 .* data(:,1)); %the wor...

en dag ago | 0

Load more