Community Profile

# Walter Roberson

##### Last seen: Today
45,856 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 all

Contributions in
View by

How do I extract the HH:MM:SS.FFF portion of a julian day time stamp?
times = regexp(Data_Time_Stamps_Cells, '\d{1,2}:\d{2}:\d{2}\.\d{3}', 'match', 'once'); But you might as well do cellfun(@(D) D...

30 minutes ago | 0

How can I change range codes in to conditional?
for Vector = randi ([0,99],1,10000) At any one time, Vector is going to be a scalar. That makes the name misleading, but it is ...

37 minutes ago | 0

can't get ny script running. What could be the problem?
w=a*randn(350,1); so w is length 350 n = 400000; for i = 1 : n so i will go to 400000 resultant(k)=proc_1(k)+w(k); k is no...

1 hour ago | 0

Creating Matlab plot with multiple mesh models, only one with CDATA
surf(x1, y1, z1, c1); hold on surf(x2, y2, z2, c2); surf(x3, y3, z3, 'facecolor', 'g') hold off

1 hour ago | 0

Converting a mathematica if statement
f = (abs(x) <= abs(y)).*sign(y); Which can be done in vectorized form. k_x = A*f; k_y = -k_x; k_z = zeros(size(k_x)); No lo...

2 hours ago | 0

How to write cell array to excel file
If the desired output is a worksheet in which the first column has 10 rows, and the second column has 5 rows, and then the next ...

3 hours ago | 1

Error in multiplying corresponding elements in matrices
syms x y h k That is equivalent to x = sym('x'); which would create x as a 1 x 1 symbolic variable. for i = 2:(N+1); x(...

3 hours ago | 0

How to build a matrix with "sum" function in its elements?
sxb = C(b) .* cumsum(A.^(1:p)) .'; You might then want to Sub = flipud(hankel(flipud(sxb)))

3 hours ago | 0

How can I modify a command from the command window?
In the command window, press up-arrow repeatedly until it offers you the command you wish to edit. Then use the arrow keys or mo...

3 hours ago | 0

Increase brightness in part of an image
Depending on how you are constructing your "complex geometry", sometimes you can construct masks to select pixels. For example y...

4 hours ago | 0

| accepted

Accessing elements of the matrices from an array of matrices
You cannot do that. Once you construct matrix = [A B C D] then MATLAB throws away all information about how the matrix was const...

4 hours ago | 0

| accepted

How do I solve a system of ODE with time-dependent parameters ( as discrete points, not as function) in MATLAB?
When parameters change in discrete ways, then those are discontinuties in the function, and the ode*() routines cannot deal with...

4 hours ago | 0

Transfer Function with Data in Table
arrayfun(@(k,d) tf(k,[d 1]), K, D) ... as a guess about what you intend. The same thing can be done in one tf() call: tf(num2...

4 hours ago | 0

How can I begin overwriting a txt file from a specific line?
You can fopen the file with 'w+' permission. You cannot go directly to the the desired line. You can though fgetl or fgets to r...

6 hours ago | 0

| accepted

R2015a compatibility with Mac OS Catalina (10.15)
R2015a is *not* compatible with Catalina.

6 hours ago | 0

Perform AND operations with multiple matrices
M = {rand(15), rand(15), rand(15)} ; c = rand(1, 3) ; cc = num2cell(c); fold(@and, cellfun(@(V,C) V == C, M, cc, 'uniform',...

13 hours ago | 0

| accepted

Using fprintf to write to multiple files simultaneously
You are correct, any one fprintf() can only write to one place at a time. You should have a look at diary

14 hours ago | 1

OFDM Trasnmitter and Receiver (Matlab Code)

14 hours ago | 1

Your last set of constraints includes X(i)<= m*Y(i) where m=inf and Y is binvar(). binvar() have a value of either 0 or 1. W...

15 hours ago | 0

integration error in matlab
When the Symbolic Toolbox is not able to integrate a function, then it returns a placeholder int() expression showing where the ...

15 hours ago | 0

fzero of function 3 variables
fzero() is designed for single functions of one variables that return scalar values. fsolve() from the Optimization toolbox can...

15 hours ago | 0

how to prevent printing output of Neural Network in command line
P = [1 2 3]; T = [2.0 4.1 5.9]; evalc('net = newrb(P,T)');

20 hours ago | 0

| accepted

Getting a warning when I fplot
fplot passes a vector of values into the function, so in C, T will be a vector of values. But you are using T as the upper bound...

23 hours ago | 0

imshow(uint8(imagematrix)) and imshow(int8(imagematrix)) gives different results although pixel values are between 0-255
>> uint8(255) ans = uint8 255 >> int8(uint8(255)) ans = int8 127 When you int8() data that is in the range 0...

24 hours ago | 1

| accepted

Is there a way to find a global minimum using genetic algorithm?
Genetic algorithms use the function handles they are given as "black boxes" (ga cannot examine how the function works.) In all a...

1 day ago | 1

| accepted

Ode45, evolution giving NaNs after some time, with no evidence of singularities in the equations
Your first order, e1, gets to be more than 1.0, and then the sqrt(1-x^2) gets to be complex. Problems accumulate from there. Wh...

2 days ago | 1

| accepted

Automatically create variations of the same variable?
Do not use separate variables. use a cell array. You can have a table of range entries and loop through a list of check boxes, p...

3 days ago | 1

| accepted

Skipping for loop with continue does not work
See http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F

3 days ago | 1

for loops and if statements
if ys >= 100 ys is a vector. When you compare a vector to a value, the result is a logical vector of results. When you...

3 days ago | 0