Community Profile

photo

Walter Roberson


Last seen: Today
50.595 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
Why do I keep obtaining complex matrices if I have only real values?
When you use root() or solve() of a degree 4 polynomial, some of the terms of the computation inherently involve imaginary compo...

circa 2 ore ago | 0

Answered
~isequal and ~= not working
if ~iseuqal(transpose(ValueOfd), m) disp("A is not diagonalizable") else disp("A is diagonalizable") end

circa 2 ore ago | 0

Answered
custom axis at the imshow
Your tick marks are not linear in x or in y. On my monitor, the distance between the first -15 and 0 is close to 1 cm more than ...

circa 6 ore ago | 0

Answered
Need help with a for loop implementation for the below code
map(:,:,itrial) = sparse(ceil(eye.y(~blink)/binsz)+y0,ceil(eye.x(~blink)/binsz)+x0,1,sz(1),sz(2)); The right hand side appears ...

circa 7 ore ago | 0

Answered
Need help with Reed-Solomon Coding
n = 255; img = imread('pout.tif'); binary = img > 102; resized = imresize(binary,[291 247]); [row k] = size(resized); g...

circa 17 ore ago | 0

| accepted

Answered
Check for missing argument or incorrect argument data type in call to function 'sinc'.
The code works for me. You might have a sinc.m of your own that is interfering. Check which -all sinc You might see /Applicat...

circa 17 ore ago | 0

Answered
How to use "ga" (genetic algorithm) for curve fitting
cost_wrapper = @(x) Cost(x(1),x(2),x(3),x(4),x(5),x(6)); coef = ga(cost_wrapper, 6)

circa 17 ore ago | 0

| accepted

Answered
Please help! Am trying to find c(n)
k is a symbolic variable. You can never use a symbolic variable as part of an index, the way you do in c(n-k) You are confusin...

circa 19 ore ago | 0

Answered
Plotting a logical function if a value is greater than 0
torvals = linspace(0,6); ntor = length(torvals); C = categorical(nan(ntor,1), (1:6),{'AB', 'BC', 'CA', 'AG', 'BG', 'CG'}, 'o...

circa 20 ore ago | 0

Answered
Tic-tac-toe winner check
xmask = TTCboard == 1; if all(xmask,1) || all(xmask,2) || all(diag(xmask)) || TEST_FOR_THE_OTHER_DIAGONAL x wins end

1 giorno ago | 0

| accepted

Answered
help request in EEMD (Ensemble Empirical Mode Decomposition)
The eemd function you supply can only return modes, but your sample code asks for residual as well, so you must not be using tha...

1 giorno ago | 0

| accepted

Answered
How to call a .txt file containing dates in format "01-JAN-2019" and time against three other independent variables to MATLAB?
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/584765/data.txt'; t = readtable(filename, 'Format'...

1 giorno ago | 1

| accepted

Answered
How to find values for corresponding elements
wanted_output = nan(length(time_vector),1); mask = islocalmax(Q); wanted_output(mask) = Q(mask);

1 giorno ago | 1

| accepted

Answered
How to open Matlab with specific scripts in my editor?
See https://www.mathworks.com/matlabcentral/answers/344124-restore-open-files-in-editor-from-previous-sessions https://www.mat...

1 giorno ago | 0

Answered
How to use solve with a equation with limit
syms b1 c1 s a = 1; b = 7.598; c = 6.784; kp = limit(20.185/(a*s^2+b*b1*s+c),s,0) Notice this is constant, not dependent on...

1 giorno ago | 0

| accepted

Answered
How to close graph help popup from command line?
Perhaps https://www.mathworks.com/help/matlab/ref/disabledefaultinteractivity.html See also https://www.mathworks.com/help/mat...

1 giorno ago | 0

Answered
Finding a variable between a a lot of m files
In the main MATLAB command window, look on the HOME tab, in the ribbon, 5th entry is "Find files". Click on there and you will b...

1 giorno ago | 0

| accepted

Answered
matlabFunction: Index exceeds the number of array elements for Matlab R2021a
matlabFunction has a bug in writing any function using piecewise to a file in expression that is complicated enough that the fun...

2 giorni ago | 0

| accepted

Answered
How to define a binary decision variable as upper and lower bond in an optimization function?
https://www.mathworks.com/help/gads/particle-swarm-optimization-algorithm.html You cannot use integer constraints with the Mat...

2 giorni ago | 1

Answered
Problem with matlabFunction throwing error in latest MATLAB version
There is a bug in matlabFunction in R2021a, in a section of code that did not exist at all before (and had no analog at all befo...

2 giorni ago | 0

| accepted

Answered
MATLAB write a function that generates n x n matrix WITHOUT built in functions.
Your S is symmetric. However, your code uses the undefined variable A B = A' + A; B(1:n+1:end)=diag(A); %This part is suppos...

2 giorni ago | 1

Answered
fprintf returns blank square for value of 1?
You are trying to use a %s (string) format to display floating point data. Use a %f or %g format instead. DRAT = [72 105] fpri...

2 giorni ago | 0

| accepted

Answered
Factorial(1000) as number
vpa(factorial(sym(1000)))

2 giorni ago | 0

| accepted

Answered
how to make nxn matrix
n = 7 d = ones(1,n-2)/2; M = zeros(n,n) + diag([0,d],+1) + diag([d,0],-1); M(1) = 1; M(end) = 1; M

2 giorni ago | 1

| accepted

Answered
Need to find the smallest [n] such that the sum for a harmonic series is greater than some value X.
n = 25000; %max number of rows that will print S = 0; %initial starting value of sum for i...

2 giorni ago | 1

| accepted

Answered
Correction of misspelled words in data source
If you are dealing with a text file, I would suggest rewriting in terms of regexp() with named tokens S = sprintf('Signal1: 5,...

2 giorni ago | 0

Answered
Error using load Unable to read file 'iris'. No such file or directory.
When you do not give a file extension when you load(), then the only one MATLAB will search for is .mat . Your file is a .data f...

2 giorni ago | 0

Answered
How to save a txt file in matlab with the specified name I want?
fullname = fullfile('directory path', [filename '.txt']); save(fullname, 'A', '-ascii')

2 giorni ago | 1

| accepted

Answered
Using Matlab for solving symbolic equations
you have 11 equations in about 17 variables, and you ask to solve the equations in terms of one of the variables. When you are u...

2 giorni ago | 0

Answered
Error using odearguments (line 113) Inputs must be floats, namely single or double.
You need to use matlabFunction() to turn your symbolic expressions into numeric code. Be sure to use the 'vars' option to contro...

2 giorni ago | 0

Load more