Community Profile

# Walter Roberson

44,560 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.

View details...

Contributions in
View by

How to turn a camera webcam into a video.
camera = VideoReader('slow.avi') nnet = alexnet; % Load the neural net pic = image([]); while hasFrame(camera) pict...

3 hours ago | 1

| accepted

How to create a circle within a matrix
x=-.10:.002:.10; %note change from 0.02 to 0.002 [X,Y]=meshgrid(x); % xy space v1=zeros(size(X)); % previo...

5 hours ago | 1

| accepted

how save results?
save() permits using a wildcard, such as save('filename.mat', 'z_room*') save() also permits a -regexp option for more complic...

8 hours ago | 0

| accepted

Function: Compare each Element of 2 Matrix for zero and non-zero
Z2 = Z^2; output = all(all(~Z2 | Z));

9 hours ago | 0

bin_data=imbinarize(r_data);
You need to have the Image Processing Toolbox installed and licensed. Note: imbinarize was new in R2016a, but you do have a ver...

9 hours ago | 0

Using a network license on personal computer

9 hours ago | 0

How to get cluster more than 2 if i have :
Cluster1 = Y1 > Y2 & Y1 > Y3 & Y2 > Y3 Cluster2 = Y1 > Y2 & Y1 > Y3 & Y2 <= Y3 Cluster3 = Y1 > Y2 & Y1 <= Y3 %Y2 < Y...

10 hours ago | 0

Extra commas when using fprintf
Replace fprintf("%.4f," ,M(:,:,i)); With Temp = M(:, :, i) ; fprintf("%.4f," ,Temp(1:end-1) ); fprintf("%.4f...

12 hours ago | 0

Error Movie contains unitialized frames
Zach(i,size(r,2)) = getframe; You are creating a 2d array of frames in which you assign into the last column. The other col...

12 hours ago | 0

Call a function in a sub directory?
cd to the inner directory and create a handle to the function, and cd back. Now when you invoke the handle you get the inner fun...

13 hours ago | 0

Genetic Algorithm Optimizatioin - Error
D:\Matlab\mrst-2018a\modules\octave\rng.m You need to get that off of your MATLAB path. There is also a fair risk that other ...

1 day ago | 0

How to solve nonlinear equation with unknown variables?
No, it should not give you a real number. You did not tell MATLAB that x is restricted to reals, so it is proper that solve() re...

1 day ago | 0

| accepted

Why .fig file looks different in different MATLAB versions ?
As of R2014b, Handle Graphics 2 (HG2) started being used. One aspect of HG2 is that uicontrols no longer automatically render on...

1 day ago | 0

How to find index of rows without -999
find(~any(YourArray == -999,2))

1 day ago | 0

| accepted

Make comet move with respect to a function
You cannot do that with comet(). comet() requires that you pre-define all of the points, and it moves them however fast it wants...

1 day ago | 0

save a probability matrix (range [0, 1]) as grayscale image with range [0,1]
For the low level stuff: https://www.mathworks.com/matlabcentral/answers/7184-how-can-i-write-32-bit-floating-point-tifs-with-n...

1 day ago | 0

index exceeds array bounds
disp=("Acceleration is now equal to: ") That line redefines disp from being a function into being a scalar string object. You n...

1 day ago | 1

editing a string using GUI editable text/popup within guide
user_input_food = handles.food_textbox.String; %assuming you named the edit uicontrol food_textbox user_input_amount = h...

1 day ago | 0

| accepted

index variable based on time points
output = zeros(size(mri,1), size(mri,2), 35, 40, class(mri)); for t = 1 : 40 output(:,:,:,t) = mri(:,:,35*(t-1) + (1:35));...

1 day ago | 0

| accepted

Minimize Function with multiple inputs
We end up with a fuel flow rate, which I need to minimize by variying the 4 variables. You have a single objective. You can use...

1 day ago | 0

What plans are there for native support on ARM v8 64 bit CPUS
You need to contact your sales representative and enter into a Non-Disclosure Agreement to get information on that topic. My own...

1 day ago | 0

how to evaluate definite integral
Your ep is 1 x 11 so for each scalar x your f would want to return 1 x 11. integral() does not expect that: integral() expects t...

1 day ago | 0

| accepted

Trouble with 'global' & 'ode45' with plot in TDM spr-mass-damp. system
[t,x] = ode45(@ydot,(0:1),[0 0 0 0]); z = x(((3/4)*end:end),1); When you pass a vector of exactly 2 elements in as the...

1 day ago | 0

How to reduce For loop execution time?
>> tic;s = sum(exp(-sum((reshape(proc(1:3), [], 1) * (1:1000000000)).^2))); toc Elapsed time is 55.136908 seconds. This was sl...

1 day ago | 0

| accepted

How to change block order between MatLab Sessions (Psychtoolbox)
rng('shuffle') seeds the random number generator based on the current time so that RAND, RANDI, and RANDN produce a dif...

1 day ago | 0

This error keeps popping up and I have no idea why: Error using viscircles Expected input number 1, centers, to be real. Error in viscircles>validateCentersAndRadii (line 283) validateattributes(centers,{'numeric'},{'nonsparse','real', ... Erro
You did not give us any values to test with for A, B, C, D E = sqrt(A^2 + D^2 - 2*A*D*cos(theta)); Looks like the area of a tr...

2 days ago | 0

| accepted

why save '.mat' as 'ascii' file appears as FILE instead of txt
filename1 = fullfile(name_folder_new,'coefficients_m'); No file extension is put on by default when you do that, so MS Windows ...

2 days ago | 1

bitxor of two numbers
c = typecast( bitxor(typecast(x, 'uint64'), typecast(y, 'uint64')), 'double'); Expect to see a lot of values in the range 1e-30...

2 days ago | 0