Community Profile

photo

Walter Roberson


43,308 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
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...

7 hours ago | 0

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

8 hours ago | 0

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

20 hours 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] ...

20 hours ago | 0

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

23 hours ago | 0

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

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

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

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

1 day 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,'; ...

1 day ago | 1

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

1 day ago | 0

Answered
What is the meaning of "Index in position 1 exceeds array bounds (must not exceed 1)".
Use the flow shown in https://www.mathworks.com/help/symbolic/odefunction.html#bvlo6zg-1 Replace [M,F]=massMatrixForm(eqs,vars...

1 day ago | 1

Answered
concatenating arrays and matrix
Borrow my code from your previous question https://www.mathworks.com/matlabcentral/answers/475006-threshold-multiple-values-at-t...

1 day ago | 0

| accepted

Answered
Write line by line a separated .csv file with a string \t an integer \t [a n*2 matrix written in line with commas and semicolon]
You will find it tricky to output the variable-length data if you use fprintf() in vectorized form. It is possible, but the code...

1 day ago | 0

Answered
Simulink Question - How to input a decimal value and output hexadecimal string?
Which release are you using? Until R2019a, signals cannot be char. The work-around is to return uint8(dec2hex(value,SIZE)) . Whe...

1 day ago | 0

Answered
Trimming matrices to smallest size
minsize = min(cell2mat(cellfun(@size, S(:), 'uniform', 0))); newS = cellfun(@(M) M(1:minsize(1), 1:minsize(2), 1:minsize(3)), S...

1 day ago | 0

| accepted

Answered
How do i fix error : 'model' parameter must be a character vector?
[net,tr] = train(net, data_norm,group); y = sim(net, data_norm); y is going to be numeric and the same size as group result =...

1 day ago | 0

Answered
How do I allow user to choose either a folder or an image(or selective images) to run the rest of the functions?
choice = menu('How do you want to select images?', 'by folder', 'individual image'); switch choice case 0 %user c...

1 day ago | 0

Answered
Re-read the variable name
In https://www.mathworks.com/matlabcentral/answers/475899-how-to-properly-convert-variable-names-into-a-chain-of-strings-in-ma...

2 days ago | 0

| accepted

Answered
Run a loop every hour regardless of its calculation time!
https://www.mathworks.com/help/matlab/matlab_prog/use-a-matlab-timer-object.html

2 days ago | 1

Answered
Loading text files by looping through two number sequences
You do not need two loops. You can use a routine such as https://www.mathworks.com/matlabcentral/fileexchange/10959-sort_nat-nat...

2 days ago | 0

Answered
Try catch together with dbstop
Instead of using dbstop at that point, use keyboard() which gives you a command prompt in debug mode.

2 days ago | 1

| accepted

Answered
work with matrix of words and number
[unique_names, ~, idx] = unique(YourCell(:,1)); mean_per_word = accumarray(idx, cell2mat(YourCell(:,2)), [], @mean); output = ...

2 days ago | 0

Answered
Hex to Signed Int conversion of 16bit values in a Table with data type 'cell array of character vectors'
temp = uint16(arrayfun(@(S) sscanf(S, '%x'), YourTable{:,3:6})); output = reshape( typecast(temp(:), 'int16'), size(temp)); Wh...

2 days ago | 1

| accepted

Answered
How to label the adjacent same value in a matrix
bwlabel(A==1,4)

2 days ago | 0

| accepted

Answered
how to skip an error inside a loop?
try x = data.timepoints(6).cells{89, 1}{2, 1}{2, 1}(3); catch ME try x = data.timepoints(6).cells{90, 1}{2, ...

2 days ago | 0

| accepted

Answered
How can I put an arc symbol above a letter?
$\widehat{ab}$ gives something arc-ish $\stackrel{\frown}{ab}$ gives an arc, if not the prettest of them. Or $\frown \atop ...

2 days ago | 0

| accepted

Answered
How do I transfer an Individual DEMO MATLAB license to a new computer?
My recollection is that DEMO licenses cannot be transferred -- but you can ask for a new DEMO license for the other system.

2 days ago | 0

Answered
For loop and subplot
subplot(6,2,2*i-1) subplot(6,2,2*i)

2 days ago | 0

Answered
How to change the origin axis of image?
ax = gca; set(ax, 'YTickLabel', get(ax, 'YTick') - 100 )

3 days ago | 1

| accepted

Load more