Community Profile

# Walter Roberson

Last seen: Today Active 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. I am currently caught up to T0099000; if you are waiting on a reply from me for an older issue, please send me a reminder.

Programming Languages:
C++, C, MATLAB, Shell, Perl, Fortran
Spoken Languages:
English

All

#### Content Feed

View by

integration of erf function
syms c p d cpd u x real Pi = sym(pi); phi(cpd) = 1/sqrt(2*Pi) * int(exp(-x^2/2), x, -inf, cpd) f = int(exp(-p)*phi(c*p+d), p,...

ongeveer 10 uur ago | 0

| accepted

The table is fixed width. Use fixed width import options; https://www.mathworks.com/help/matlab/ref/matlab.io.text.fixedwidthimp...

ongeveer 11 uur ago | 0

Invalid expression error when I try to introduce new variable.
You cannot just define a constant inside a class by assigning to it, and expect it to be available to your functions. You can c...

ongeveer 11 uur ago | 1

How to graph a function that consists of summations?
g = ga(:); T=(0.1:0.001:1); E = reshape(0:13, 1, 1, []) ; F1 = sum(-(E.^2).*g.*exp(-(E-13)./T),3); F2 = sum(-g.*exp(-(E-13...

ongeveer 12 uur ago | 0

zero pad array to multiple of 8
A_padded = A; new_rows = ceil(size(A,1)/8)*8; new_cols = ceil(size(A,2)/8)*8; if new_rows ~= size(A,1) || new_cols ~= size(A,...

ongeveer 14 uur ago | 1

| accepted

How to solve single non-linear equation?
syms A B n X(t) V(t) eqn = diff(V(t) .* X(t)/(1-X(t)), t) == A*n - A*X(t) - B*X(t) SE = simplify(lhs(eqn) - rhs(eqn)) collect...

ongeveer 15 uur ago | 0

I have a 2 dimensional array. I want to view it.
How do you want to view it? As text? trajectories(:,1) should display the first column. However it is possible that your MATLAB...

ongeveer 15 uur ago | 1

| accepted

May I know how convert tuple to dictionary in MATLAB

ongeveer 15 uur ago | 0

Converting values to units
values = randi([0 800], 1, 10) b = [-800 300 800]; mask = values < b(2); scaled(mask) = (values(mask)-b(1))./(b(2)-b(1)); sc...

1 dag ago | 0

how to calculate theta
Xo = 1234; V = 20000; syms theta t = .1:.1:1; eqn = 3010 == Xo + (V .* cosd(theta)) .* t thetas = double(arrayfun(@(E) vp...

1 dag ago | 0

Convert units to g
%need some data for demonstration t = seconds(0:0.5:10); y = randn(1, length(t)); %now do the work y_g = y ./ 9.80665; pl...

1 dag ago | 1

| accepted

add multiple lines to a single plot without using "hold on/off"
%% Create Plots % Would like pressure dist overlaid on airfoil shape tiledlayout(2,1); ax1 = nexttile; plot(ax1,x,y); hold(...

1 dag ago | 0

| accepted

Huge number of iterations
fcn = @() fopen( sprintf( 'chem_%d.txt', labindex ), 'wt' ); w = WorkerObjWrapper( fcn, {}, @fclose ); % a and b are cell arra...

1 dag ago | 0

How to loop over a function call?
y = [y1, y2, y3, y4] fun = @(x) reshape(sum(arrayfun(@(Y) Least_square(x(:), Y), reshape(y, 1, [])),2), size(x))

1 dag ago | 0

| accepted

Can not shift image relative to plot with Imtranslate
and shown with imshow(image) I do not recommend imshow() for this purpose: it does too many things to the axes that are not des...

1 dag ago | 1

| accepted

Initializing all rows with one set of values in one half and another set in the other half
cA(:,:) = repmat([cA0*ones(1,(N-1)/2+1),Kw/cB0*ones(1,(N+1)/2-1)], size(cA,1), 1); Or consider nrow = size(cA,1); cA(:,:) = [...

1 dag ago | 0

| accepted

Saving data array in Matlab data file (.mat) in App Designer
save('YourFileName.mat', 'NameOfVariable', 'AnotherVariable') Note that if the values you want to save are currently stored wit...

1 dag ago | 1

| accepted

mask = cellfun(@isdatetime, YourCell); YourCell(mask) = cellfun(@(DT) datetime(DT, 'format', 'dd/MM/yyyy'), 'uniform', 0); Now...

1 dag ago | 0

how to join the values of different cells in different columns in one cell ?
T.Date = datetime(T.Year, T.Month, T.Day, T.Hour, T.Min, 0, 'Format', 'uuuuMMddhhmm'); Note: I did not use the format you asked...

1 dag ago | 1

| accepted

Issue with numerical integration of two variable function
A = @(x, y) cos(x)+sin(y) B = @(x, y) A(x,y)-integral(@(X)A(X,y), 0 , 2*pi, 'ArrayValued', true) fsurf(B, [-pi pi -pi pi])

1 dag ago | 0

How to Solve matrix equations in Matlab
Optimal solutions, in the sense of smallest least-squared. Are there other solutions? Yes: you can ask to solve eqn2 with retur...

1 dag ago | 1

Finding 8 points on an ellipse
Refering to https://math.stackexchange.com/questions/493104/evaluating-int-ab-frac12-r2-mathrm-d-theta-to-find-the-area-of-an-el...

1 dag ago | 1

| accepted

Trying DIC 2D by ncorr
I notice that you are using a fairly old version of MATLAB. Still, uibuttongroup() should have been defined in your MATLAB. T...

1 dag ago | 0

Error in plotting an equation given y data sets (y vs x)
Your code wants to calculate the formula for each y value, for all possible x values. But to do that, you have to make the symbo...

1 dag ago | 0

| accepted

filtfilt fails with B=1, A=1 on matrix
It appears to be a bug. In context: filtfilt() calls filter() to do some of the work. When a and b are scalars, filter is goi...

1 dag ago | 0

Clear symbolic from an equation and make it mathematical function
syms x f=(17*exp((281*x)/50000))/1000 + (4777*x*exp((281*x)/50000))/50000000 ff = matlabFunction(f); x=4.5:1:40.5; plot(x,...

2 dagen ago | 0

| accepted

how to find a float number
[is_there, idx] = ismembertol(-0.3340, y7) %options allow you to control tolerances y7(idx) Also, [~, idx] = min(abs(y7(:) -...

2 dagen ago | 1

Solve a system of linear ODEs, and plot them
You built R as a column vector but your vector of constants 10^-7 and so on is a row vector. You will accidentally creating conf...

2 dagen ago | 1