Beantwortet
How can I obtain the T and Y for R Runge Kutta method?
Store the first version starting with "function R=rk4(f,a,b,ya,M)" in a file called "rk4.m" and save it to a folder, which is i...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Gurobi mex file cannot be found despite it being clearly there
Use the Dependency Walker to find out, which library is missing: https://www.mathworks.com/matlabcentral/answers/95906-how-do-i...

mehr als 4 Jahre vor | 0

Beantwortet
find the equal values that stand together on the same row or column or diagonal in the matrix
Maybe you mean: pool = [-1, 1, 2]; index = randi([1, 3], 15, 15); data = pool(index); match = conv2(data > 0, ones(3, 3)...

mehr als 4 Jahre vor | 1

Beantwortet
Index in position 2 exceeds array bounds (must not exceed 1).
dx1dt = x4 .* cos(x5) .* cos(u3); % Now dx1dt is a scalar ... x(1,i) = x(1,i-1) + h * dx1dt(1,i-1); % This treats dx1dt ...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Storing values from a for loop
B = 1000; R2 = zeros(1, B); % Pre-allocation for iter = 1:B ... R2(iter) = 1 - sse / sst; end A problem is, that R...

mehr als 4 Jahre vor | 0

Beantwortet
Newton's method - problems in calculating alpha value
In the lines: func = @(x) eps * c_s * x^4 + (alpha_k + 1/(s1/lamda1+s2/lamda2)) * x - ... ((1/(s1/lamda1+s2/lamda2...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
how to declear global "import java.awt.Robot" and "import java.awt.event.*"?
If such a global import is possible, it might destroy Matlab's stability. The imported functions without wildcards have a higher...

mehr als 4 Jahre vor | 0

Beantwortet
Performance of log() is wildly different in two different contexts and machines for same data?
Summary: On the 16 GB M1 MacBook, the lines tic tdg_log = log(tdg); toc displays, that the processing needs 1.5 seconds. U...

mehr als 4 Jahre vor | 0

Beantwortet
Numerical integration of discrete data using higher precision
You explain, that you have discrete data, but the code you show uses a function. If the data are given in double precision, usin...

mehr als 4 Jahre vor | 0

Beantwortet
Passing multiple Arrays to loop a Function and creating a 1 column array
The code contains some strange details: A = ArrayA; (1,000x1) Double Please use the standard notation. I assume this would be ...

mehr als 4 Jahre vor | 0

Beantwortet
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
Let Matlab stop at the error using the debugger: dbstop if error Then run the code again. If it stops, chek the sizes of the u...

mehr als 4 Jahre vor | 0

Beantwortet
how do I put waitbar inside a figure (Matlab 2016a)?
You find a lot of examples in the FileExange. Search there for "porgressbar": https://www.mathworks.com/matlabcentral/fileexcha...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Calculationg with quternions Matlab function did not work
function p_A = q_transform_coordinate_vector(R_A_B, p_B) % ^^^^^ p_A = q_A_B * q_pu...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
Error using reshape: Size arguments must be real integers. Except all values are positive whole numbers?
Change: raw_data.variable_mat = raw_data.variable_mat(:,1:reshape_val); to raw_data.variable_mat = raw_data.variable_mat(:,1:...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
How to solve this error: =: nonconformant arguments (op1 is 1x1, op2 is 100x1)?
T = linspace(0, 10)'; % Time f = 0.1; % Frequency Am = 10; % Phase F = Am*sin(2*pi*f*T); % Sin wave input Now F is a [100, ...

mehr als 4 Jahre vor | 0

Beantwortet
Can I hit the "OK" button on inputdlg through coding?
See this example for creating your own dialog with a timer: https://www.mathworks.com/matlabcentral/fileexchange/24871-autowarnd...

mehr als 4 Jahre vor | 0

Beantwortet
Interpolation method of IMAGE
x = zeros(640, 480, 3); x(:, 1:2:end, :) = 1; image(x) This looks confusing to me in the online version: Where are the steps ...

mehr als 4 Jahre vor | 0

Beantwortet
MEX-file efficiency with multiple file-pass function calls in .m script
Do you use the terms "function" and "script" correctly? Functions and scripts are stored in .m-files. Functions start with the ...

mehr als 4 Jahre vor | 0

Frage


Submit button not working sometimes
A few weeks ago the Submit button in this forum stopped to work for me in about 50% of the cases. Then I copy my answer or comme...

mehr als 4 Jahre vor | 2 Antworten | 3

2

Antworten

Beantwortet
Linear indexing in 3D matrix
Look into the code of sub2ind. It is easy to create an inline version of what you want: s = [2, 3, 4]; x = reshape(1:prod(s), ...

mehr als 4 Jahre vor | 0

Beantwortet
I am facing problem regarding storage of values for d() using for loop which is of 100x100 size for each iteration of a and k.
You overwrite the data by zeros repeatedly: for t=1:L for v=1:elements for w=1:elements % Here all f...

mehr als 4 Jahre vor | 0

Beantwortet
removing zeros from matrix
x(x==0) = []; % Or: x = x(x~=0); Where do the zeros come from? Instead of removing them it might be easier to avoid to crea...

mehr als 4 Jahre vor | 0

Beantwortet
Trisurf : How to interactively change the plot opacity?
GUIs are not hard to control. function testGUI % Some test data: [x,y] = meshgrid(1:15, 1:15); tri = delaunay(x,y); z = pea...

mehr als 4 Jahre vor | 0

Beantwortet
How to take output from one program as input in the same?
Of course this is possible. A trivial example: function main [a, b] = thePoints; alpha = theAngle(a, b); disp(alpha) end ...

mehr als 4 Jahre vor | 2

| akzeptiert

Beantwortet
How to center a cloud of data points (x,y,z) to coordinate origin in 3-D space?
I'm not sure, what "center each marker" means. But I assume you want to subtract the mean value: trajectory = [167.282166 37...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
solve an ode with three methods in the same script
Each function has its own workspace. The results of the called scripts are stored in the workspace of the function mainfunctionm...

mehr als 4 Jahre vor | 0

Beantwortet
If it is possible to display matlab's command window in app designer's text area?
See: FEX: CmdWinTool cmdWinDoc = com.mathworks.mde.cmdwin.CmdWinDocument.getInstance; initial = cmdWinDoc.getLength; % Ru...

mehr als 4 Jahre vor | 1

Beantwortet
Split cell each 13 characters
It would be usful, if you post your input data and the wanted output. Currently I find the information matrix of about 32x1 ea...

mehr als 4 Jahre vor | 0

Beantwortet
Reverse of find groups
Use the 2nd output of findgroups: A = [1,1; 1,2; 2,2; 3,3; 3,4; 1,3; 1,2]; [G, ID1, ID2] = findgroups(A(:, 1), A(:, 2)); AG =...

mehr als 4 Jahre vor | 0

Beantwortet
Discrepancies between single and double precision sum over time
This is the expected behaviour. Remember that the sum is an instable numerical operation. d = zeros(1,1e7); s = zeros(1, 1e7, ...

mehr als 4 Jahre vor | 0

| akzeptiert

Mehr laden