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 ...

1 month ago | 2

| accepted

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...

1 month ago | 0

| accepted

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...

1 month ago | 0

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...

1 month ago | 1

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...

1 month ago | 0

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 =...

1 month ago | 0

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, ...

1 month ago | 0

| accepted

not able to solve the integration function
This cannot work: x(j) = linspace(0,0.025,101); On the left is a scalar and on the right a vector with 101 elements. Seeing o...

1 month ago | 0

How to work with Struct With Struct construction
It is not clear, how the inputs data exactly look and what you want as output. Prefer to post some code, which produces both. M...

1 month ago | 1

| accepted

Create diagonals along a block matrix
With some bold guessing and knowing, that this might be more confusing than useful: The input A is a cell vector and the wanted...

1 month ago | 0

| accepted

Why do I get "Array indices must be positive integers or logical values." Error
global net_stg9; % Previously trained network netw = net_stg9; my_output = netw(my_input); netw seems to be an array, not a t...

1 month ago | 0

| accepted

How to plot 50 figures each has 3 curves for loop
You show us the code to create one set of lines. Then simply add this command before plotting: figure() axes('NextPlot', 'add'...

1 month ago | 0

| accepted

For loop not working for me
xx = x_initial:dx:-1*x_initial; if xx(i) == -1.75e-6 You cannot expect a specific value in the vector xx, because it is create...

1 month ago | 1

Inverse of matrix multiplied by vector
K = [ 168.57 4296.29 7250; ... 0 998888.89 241666.67; ... 0 0 106333...

1 month ago | 0

Sum 2 Matrices and take the average value of their summation and store them in another Matrix with the same dimension.
"I want to take the average of the sum of these two variables, then store the new value in C_Total_up" C_Total_up = (C_Total_1 ...

1 month ago | 0

| accepted

'The variable appears to change size on every loop iteration'
Some hints: addpath(user_direct); - Append only folders to Matlab's path, which contain M-files. Avoid to include folders cont...

1 month ago | 0

How do I use the cat function?
Whenever you have an error for a specific command, read the help section at first: help cat % Or more exhaustive: doc cat Yo...

1 month ago | 0

| accepted

Find discontinuities and lift up or pull down the part after the discontinuity
x = linspace(1, 10*pi, 200); y = sin(x); y(60:90) = y(60:90) + 1; y(120:180) = y(120:180) - 1; yOrig = y; limit = 0.2; d...

1 month ago | 1

| accepted

How to collate two mat files with similar name pattern from two different sub-folders?
Maybe you want: all_Mt2files = dir(fullfile(subfolder1, '*.mat')); all_Dotfiles = dir(fullfile(subfolder2, '*.mat')); for k...

1 month ago | 0

| accepted

vectorization of comparison against several intervals
Easier to run in the forum and maybe faster already: N = 1000; M = randi([1, 1000], N, N); C = sort(randi([1, 1000], 100, 2),...

1 month ago | 0

| accepted

How to speedup the following
N = 200; A = rand(N, N, N); D = rand(N, 1); tic % Original S = zeros(N); for i = 1:N for j = 1:N S = S + A(:,...

1 month ago | 1

| accepted

How to delete an item in a matrix by comparing the correlation with the next neighbor in a same column
With bold guessing: A=[0,0,0,0,0,0,11,22,33,44,63,23,6,0,0,3,4,6,7,3,4,0,5,0,0,9,4,14,22,0,0,0,0,0,0,0,0,0,0,0,3,4,0,0,0; ... ...

1 month ago | 0

how to get a plot of second ODE
The interval is: tspan = [0 50] In the first step you evaluate: yp(2)= y(1) / (t.*j) - (y(1)/(t.^2 .*j)) - (3.*y(2)./t) for t...

1 month ago | 0

| accepted

Question

Why is the string type not implemented as standard type?
The string type is impelemented as opaque class and not as standard type as doubles of chars. This makes it inefficient to acces...

1 month ago | 2 answers | 0

### 2

Really am I simulation this system with ODE45? How am I can optimizing the code?
Your function to integrated contains linear intepolations of parameters. Then the outpuzt is not smooth. Matlab's ODE intergrato...

1 month ago | 0

Timer with very precise period time
Under ideal conditions a high accuracy timer of the operating system inside a C-mex function. See e.g. FEX: HAT . But remember, ...

2 months ago | 1

Composition of two matrices with the same number of columns, one of them is integer-valued
n = 1e4; m = 1e4; d = 1e3; B = randi([1, m], n, d); A = randn(m, d) * 2; % Version 1: The original code tic C = zer...

2 months ago | 1

| accepted

Simulating earth rotating the sun with eulers method.
When I run your code, I do not see a linear movement: %Constants and initialising vectors G=6.674*10^(-11); %gravitational co...

2 months ago | 1