Respondida
Determine if the following series converges or diverges
Of course sum(1:Inf) is divergent. Either your answer contains a space (which is invisible in a screenshot...) or the test conta...

más de 3 años hace | 1

| aceptada

Respondida
How do i create a new .txt document for each run of a code?
fprintf does not create files, but writes into existing files. fopen is responsible for opening or creating files. folder = 'C:...

más de 3 años hace | 1

| aceptada

Respondida
Problem evaluating OR operator
if Answer == ('1') || ('2') Matlab evaluates this condition accourding to the precedence order of the operators from left to ri...

más de 3 años hace | 1

| aceptada

Respondida
I have fig file and I want export transparent file from it.
F = getframe(gcf); RGB = F.cdata; BG = get(gcf, 'color'); imwrite(gcf, 'Output.png', 'Transparency', BG);

más de 3 años hace | 0

Respondida
How to add and autofill a new column to very large dataset?
X(:, 2) = 17:0.0001:21; Note that: size(17:0.0001:21) This does not match "3 Million data points".

más de 3 años hace | 0

Respondida
Error (Index in position 1 exceeds array bounds. Index must not exceed 173.)
The error message is clear: img0 has 173 rows only, so you cannot access the indices 1:250 .

más de 3 años hace | 0

Respondida
Code for graphing bending moment is giving the wrong graph and I don't know why, can anyone help?
% sumM=0; % not here for x=0:L sumM=0; % but here for k = 1:nweights if x<=p(k) M = Wk(k) *...

más de 3 años hace | 0

Respondida
assigning array to another
Maybe: A = [2, 4, 7, 12, 56, 34, 6, 96, 11, 26]; q = mod((1:24) - 1, numel(A)) + 1; B = A(q); B = reshape(B, 4, []) Here th...

más de 3 años hace | 0

Respondida
Delete rows with the same data in the matrix
x = [1 1;2 1;2 3;4 5;1 1;1 2;3 2]; % Swapped [1,2] and [2,1] sx = sort(x, 2); % Sort the rows: [ux, ix] = unique(sx, '...

más de 3 años hace | 2

| aceptada

Respondida
How to read a single precision binary data file in to MATLAB?
The posted file has 198'618'806 bytes. This is not a multiple of 4, so it cannot contain only float values. I guess, that you a...

más de 3 años hace | 0

Respondida
from 1D vector to mesh plot
% The grid: x = linspace(-3, 3, 50); y = linspace(-3, 3, 50); R = sqrt(x.^2 + (y.').^2); % The concentration: Cx = linspa...

más de 3 años hace | 1

| aceptada

Respondida
How to create a loop with unknown number of iterations?
ready = false; k = 1; while ~ready mask = z_input < fin & z_input >= (fin - k); if any(mask) ready = tr...

más de 3 años hace | 0

| aceptada

Respondida
how to change datetime cell to matrix array
TT = cat(1, T{:})

más de 3 años hace | 1

| aceptada

Respondida
I would like help setting up my code
up1 = strfind(con.', ones(1, 100)); up2 = strfind(con.', zeros(1, 80)); up = intersect(up1, up2 - 21); Cleanup detections wi...

más de 3 años hace | 0

Respondida
Why is the MATLAB's Generalized Laguerre function significantly slower than that of scipy-python
It seems to be a symbolic computation in the Matlab implementation. With a numerical solution the function is much faster: tic;...

más de 3 años hace | 2

| aceptada

Respondida
Get min from group(s) of data within an array
Is the 4th row a counter for each day? Then this can be used: (By the way, please post input data in a form, in which they can ...

más de 3 años hace | 1

Respondida
How to apply or operator on the components of a vector?
any(v) % If n is not the number of elements: any(v(1:n))

más de 3 años hace | 0

| aceptada

Respondida
modify anonymous function using eval
Use a function instead: function y = fun1(x, p1, p2, p3) if nargin == 1 p1 = 1; p2 = 1; p3 = 2; end y = x*p1...

más de 3 años hace | 0

Respondida
Can't figure out how to fix endless while loop
k = 1; Output = zeros(size(To_3)); % Pre-allocation while abs(Po_5 - Po_8) > 100 Po_8 = Po_2 * Prf; To_8 = To_2 * (...

más de 3 años hace | 0

Respondida
flushing the keyboard input after a pause.
The command window does not offer a way to flush the input buffer. But this window is a bad way to implement a user interface, i...

más de 3 años hace | 2

Respondida
How to sort a complex vector with tie breaker angles between [0, 2π)?
Maybe it helps to sort the rotated values: a = [2, -1, i, -i]; [~, idx] = sort(-a * 1i); a(idx)

más de 3 años hace | 0

Respondida
error "Undefined function 'sumabs' for input arguments of type 'double'. Error in Gauss_Seidel (line 63) h=sumabs(A(i,:))-abs(A(i,i));""
% h = sumabs(A(j,:))-abs(A(j,i)); h = sum(abs(A(j,:))) - abs(A(j,i));

más de 3 años hace | 0

Respondida
How to check if two planes intersect with each other?
Planes intersect, if their normal vectors point to different directions: A = [-1140,14,16.125; -1140,14,0; -1140,10.5,-4; 1118,...

más de 3 años hace | 0

Respondida
Mean distance function upgrade question
data = table2array(readtable("test.xlsx")); % group1 = length(data(~isnan(data(:,1)))); Faster: group1 = nnz(~isnan(data(:,1)...

más de 3 años hace | 0

Respondida
How would I use the 'count' function but to only count instances of both columns being specified?
x = [1 4; 5 3;9 8; 2 7;1 8;7 2; 2 7;1 5;4 3]; n = sum(all(x == [2, 7], 2)) % Alternative: nnz() instead of sum() If the value...

más de 3 años hace | 0

| aceptada

Respondida
convert matrix of cells into matrix of vectors
There are different method to concatenate the matrices to the wanted output. One is: X = cat(1, A1{:}); X = reshape(X, 1024, 6...

más de 3 años hace | 0

Respondida
plot many channels with same x axis and repeated y axis values
X = rand(20, 200); % Some test data XX = X + (0:19).'; % Shift vertically plot(1:200, XX)

más de 3 años hace | 1

| aceptada

Respondida
Extract values from a double list
Maybe the 2nd question means: C = {'A', 'B4', 'G6', 'D5'}; D = strjoin(C, ' -> ') Use the online tutorial Kalyan has suggeste...

más de 3 años hace | 0

| aceptada

Respondida
need plot a graph using Euler's method for both numerical and analytical
h = 10; % step size x = 0:h:60; % the range of x y = zeros(size(x)); % allocate the result y y(1) = 2; % the initial y va...

más de 3 años hace | 1

Respondida
Clicking app button moves app behind Matlab's main window.
This was discussed here: https://www.mathworks.com/matlabcentral/answers/296305-appdesigner-window-ends-up-in-background-after-u...

más de 3 años hace | 0

Cargar más