Answered
What happens when an ouput port is connected to an unmerged signal after an "if/else" logic?
The if block contains a setting that controls the value of the output when the block is not selected. If I recall correctly o...

4 years ago | 0

Answered
Why are the output variables, that I expect to be real, complex?
syms omega_r omega_i real might help. If not then pass in [-inf inf; -inf inf] after the list of variables.

4 years ago | 0

Answered
how to define a frequenty domain to do an FFT over?
https://www.mathworks.com/help/matlab/ref/double.nufft.html see the f parameter This does not require uniform tspan since you ...

4 years ago | 0

Answered
matrix simultaneous equations returning 0s
FM = A3.\B3; You overwrite all of FM each iteration. The final result will be what was assigned for the final i j combinati...

4 years ago | 0

Answered
Legend for varying parameters in a loop
plot(z, f1(xi(i))) assign the result of f1(xi(i)) to a variable, say f1i. Then h(i, :) = plot(z, f1i(:, 1), 'b', f1i(...

4 years ago | 0

Answered
How to loop unifrnd(a,b) with a and b outputs of the linspace function
x = linspace(0,100,51); output = arrayfun(@unifrnd, x(1:end-1), x(2:end));

4 years ago | 1

Answered
I have a loop command in Maple, do you know how to write it in Matlab?
syms V for k = 1 : 11 X(k+1) = subs(V - G1 * EQ, V, X(k)); end

4 years ago | 0

| accepted

Answered
Bug when plotting 3 points in scatter MATLAB R2022a
Because an RGB triple is permitted at that place, MATLAB needs to have some code to decide whether you are providing RGB or you ...

4 years ago | 0

| accepted

Answered
How to make specific elements of a cell equal to zero?
newCell = cellfun(@(M) M.*(M<=0.5), YourCell, 'uniform', 0) However this will fail in locations that contain infinite values.

4 years ago | 0

Answered
Elementwise shift of two matrices
B = [8 8 7 6 9]; [i idx_B] = min(B); circshift(B, 1-idx_B)

4 years ago | 0

Answered
MATLAB/NOMAD for global optima?
Your function can return complex values. The ^(1/3) generates a complex result when the base expression is negative. format lon...

4 years ago | 0

Answered
How can i use round function to change decimal value to integer ?
format long g x = 1.5919 * 1.0e+06 round(x/10^6) If you are wanting to round to 1 significant digit, then it gets a bit more ...

4 years ago | 0

| accepted

Answered
Why numel() is not accepted with a gpuArray
https://www.mathworks.com/help/parallel-computing/gpuarray.arrayfun.html numel is not supported inside any function run on a ...

4 years ago | 0

| accepted

Answered
GEtting err0r
you have an existing *numeric* variable named x0 and so you not permitted to assign to x0.x because numeric variables cannot use...

4 years ago | 1

Answered
I got wrong data when i use datetime convertfrom
dt = hours(t) + datetime('1800-01-01 00:00:0.0')

4 years ago | 0

Answered
Is there any way to project certain matrix into the x, y coordinate system?
find the boundary points. Then https://www.mathworks.com/matlabcentral/fileexchange/3215-fit_ellipse or https://www.mathworks.co...

4 years ago | 1

| accepted

Answered
Why is my for loop code not incrementing correctly?
N = 256; last = floor(size(data1,2)/N) * 256; buffered = reshape(data1(1:last, 2), N, []); The entries will now be down colum...

4 years ago | 0

Answered
need to merge date and time in 5 separate columns in to two and then one
dt = datetime(YourTable.YYYY, YourTable.MM, YourTable.DD, YourTable.HH, YourTable.mm, 0); newTable.YYYYMMDD = dt; newTable.YY...

4 years ago | 0

| accepted

Answered
Hi, I have the following matlab structure. I want to apply zero padding according to maximum length (77). Could you kindly help? Thank you
lengths = structfun(@length,YourStructure); maxlen = max(lengths); paddedStructure = structfun(@(S) [S;zeros(maxlen-size(S,1...

4 years ago | 0

| accepted

Answered
How to produce a matrix with the following conditions?
M = ones(7); C = M; C(logical(eye(7))) = 0.4 %or M = ones(7); C = M; C(1:size(C,1)+1:end) = 0.4 %or M = ones(7); C = M ...

4 years ago | 1

Answered
How to store the following Matrix in a variable?
M = ones(7); C = M; C(logical(eye(7))) = 0.4 %or M = ones(7); C = M; C(1:size(C,1)+1:end) = 0.4 %or M = ones(7); C = M ...

4 years ago | 0

| accepted

Answered
Subplot with colormap color
cmap = hsv(5); for K = 1 : 5 thiscolor = cmap(K,:); subplot(1,5,K); plot(M{K}, 'color', thiscolor); if K ...

4 years ago | 1

| accepted

Answered
Read csv with quotes and datetime stamp (readtable configuration)
lines = {'14-Sep-2022 10:02:38.140000,"1034,19,AB"', '14-Sep-2022 10:02:38.140000,"1034,19,AB"'}; filename = tempname + ".txt";...

4 years ago | 1

| accepted

Answered
Multiple population Genetic Algorithm
Sorry, No. The internal code for unconstrained ga is able to handle "sub-populations", which for that routine is activated by t...

4 years ago | 1

| accepted

Answered
Trying to plot the multiplication of triangular and unit step signal.
t = -5:.01:5 x = (1-t) .* (0<=t & t<=1); stairs(t, x) axis equal

4 years ago | 0

| accepted

Answered
pick files within dir
dinfo = dir('*post*'); comp.files = fullfile({dinfo.folder}, {dinfo.name}); numfiles = length(comp.files); Now comp.files wil...

4 years ago | 0

| accepted

Answered
Offloading galois fields to the GPU
If you are referring to gf() from the Communications Systems Toolbox, then NO, gpuArray is not supported. https://www.mathworks...

4 years ago | 0

Answered
Drawing using if function
places = find(strcmp(N, 'Yes')); now plot() using 'MarkerIndices', places https://www.mathworks.com/help/matlab/creating...

4 years ago | 0

| accepted

Answered
How can I resize a mat file that contains images
imresize3() for r2017b or later.

4 years ago | 0

Answered
Create large array of zeros without MATLAB:array:SizeLimitExceeded (perhaps on disc)
See https://www.mathworks.com/matlabcentral/fileexchange/29832-n-dimensional-sparse-arrays instead

4 years ago | 0

| accepted

Load more