Suspensa Vix Via Fit

Answered

how to form a new matrix (i.e. B) from two different matrices (i.e. a1, a2) knowing the indices of its origional matrix (indices of a)?

You can use those indices on the left-hand side. For example: a1 = [2,6,12]; x1 = [1,3,6]; a2 = [4,8,10,14]; x2 = [2,4,5,7];...

how to form a new matrix (i.e. B) from two different matrices (i.e. a1, a2) knowing the indices of its origional matrix (indices of a)?

You can use those indices on the left-hand side. For example: a1 = [2,6,12]; x1 = [1,3,6]; a2 = [4,8,10,14]; x2 = [2,4,5,7];...

8 hours ago | 1

| accepted

Answered

Problem running an exe with path containing spaces, while saving command output

Specify double-quotes at each end of the path, e.g.: exe_path = '"C:\users\abc\test folder\test.exe"';

Problem running an exe with path containing spaces, while saving command output

Specify double-quotes at each end of the path, e.g.: exe_path = '"C:\users\abc\test folder\test.exe"';

10 hours ago | 1

| accepted

Answered

Get English version of web Matlab support

As far as I am aware, there is no way to set this in the user account. The language/locale setting is stored in the cookies for...

Get English version of web Matlab support

As far as I am aware, there is no way to set this in the user account. The language/locale setting is stored in the cookies for...

1 day ago | 0

| accepted

Answered

Sort an Array with sortrows ( ) with two columns

There are probably nicer ways to do this, as this unfortunately changes the data itself. If required, you could use the index ou...

Sort an Array with sortrows ( ) with two columns

There are probably nicer ways to do this, as this unfortunately changes the data itself. If required, you could use the index ou...

1 day ago | 1

| accepted

Answered

How to save arrays from a loop with variable names using iterator and how to perform element-by-element operations on arrays and save

"How can I incorporate the iterator i into the variable name?" Don't do that. The simpler and much more efficient approach is t...

How to save arrays from a loop with variable names using iterator and how to perform element-by-element operations on arrays and save

"How can I incorporate the iterator i into the variable name?" Don't do that. The simpler and much more efficient approach is t...

2 days ago | 1

| accepted

Answered

matrix step shift in each row

A = [1,2,3,4,5]; B = toeplitz(A([1,end:-1:2]),A)

matrix step shift in each row

A = [1,2,3,4,5]; B = toeplitz(A([1,end:-1:2]),A)

2 days ago | 0

Answered

Producing a NaN only where there is a NaN, zero otherwise

X = [-inf, -1, -eps, 0, realmin, 2, 1+i, pi, flintmax, realmax, inf, NaN]; Y = 0./(X==X)

Producing a NaN only where there is a NaN, zero otherwise

X = [-inf, -1, -eps, 0, realmin, 2, 1+i, pi, flintmax, realmax, inf, NaN]; Y = 0./(X==X)

3 days ago | 3

Answered

Numerical error using the "diff" function

V = [0,0,0,0.2,0.4,0.6,0.7,0.85,1,1,1]; D = diff(V); X = find(ismembertol(D,max(D)))

Numerical error using the "diff" function

V = [0,0,0,0.2,0.4,0.6,0.7,0.85,1,1,1]; D = diff(V); X = find(ismembertol(D,max(D)))

3 days ago | 0

| accepted

Answered

Cell array indexing question

%% Part A S = load('QuizGrades.mat'); grades = S.grades student_Names = "Student"+(1:14) student_IDs = 101:114; %% Part...

Cell array indexing question

%% Part A S = load('QuizGrades.mat'); grades = S.grades student_Names = "Student"+(1:14) student_IDs = 101:114; %% Part...

3 days ago | 0

Answered

rearrange a matrix into a vector by blocks

M = [1,3,13,15,25,27;2,4,14,16,26,28;5,7,17,19,29,31;6,8,18,20,30,32;9,11,21,23,33,35;10,12,22,24,34,36] V = reshape(permute(re...

rearrange a matrix into a vector by blocks

M = [1,3,13,15,25,27;2,4,14,16,26,28;5,7,17,19,29,31;6,8,18,20,30,32;9,11,21,23,33,35;10,12,22,24,34,36] V = reshape(permute(re...

5 days ago | 0

| accepted

Answered

extract date from date time command in matlab

You don't need another command, you just need to change the format property: https://www.mathworks.com/help/matlab/ref/datetime...

extract date from date time command in matlab

You don't need another command, you just need to change the format property: https://www.mathworks.com/help/matlab/ref/datetime...

5 days ago | 0

Answered

Load different mat files using for loop

Assuming that each mat file contains exactly one variable of unknown name, then try this: D = 'D:\ABIDEdataset\Outputs\dparsf\n...

Load different mat files using for loop

Assuming that each mat file contains exactly one variable of unknown name, then try this: D = 'D:\ABIDEdataset\Outputs\dparsf\n...

5 days ago | 0

| accepted

Answered

cell indexing, extracting rectangular subset

The simplest (and usually quite efficient) approach is to use a comma-separated list to create one cell array: tmp = vertcat(to...

cell indexing, extracting rectangular subset

The simplest (and usually quite efficient) approach is to use a comma-separated list to create one cell array: tmp = vertcat(to...

6 days ago | 0

| accepted

Answered

Computation on arrays using loops

Y = [2.659717,2.656496,2.656496,2.656173,2.662294,2.661328,2.660039,2.620416,2.614295,2.606242,2.600765,2.600443,2.590779,2.5917...

Computation on arrays using loops

Y = [2.659717,2.656496,2.656496,2.656173,2.662294,2.661328,2.660039,2.620416,2.614295,2.606242,2.600765,2.600443,2.590779,2.5917...

6 days ago | 1

| accepted

Answered

How to load all the data in one folder

"I am wonder why it happened." Because you always load exactly the same file data (note the indexing you used): filename{1,1} ...

How to load all the data in one folder

"I am wonder why it happened." Because you always load exactly the same file data (note the indexing you used): filename{1,1} ...

6 days ago | 1

Answered

Tabulating a Function with exponential values and using fprintf

The loop is not required. By vectorizing the function you can simplify your code. https://www.mathworks.com/help/matlab/matlab_...

Tabulating a Function with exponential values and using fprintf

The loop is not required. By vectorizing the function you can simplify your code. https://www.mathworks.com/help/matlab/matlab_...

6 days ago | 0

Answered

Why do I get "0x301 empty double matrix" when reading a cell array with data in it?

"Why do I get "0x301 empty double matrix" when reading a cell array with data in it?" Because you specified two header lines, b...

Why do I get "0x301 empty double matrix" when reading a cell array with data in it?

"Why do I get "0x301 empty double matrix" when reading a cell array with data in it?" Because you specified two header lines, b...

6 days ago | 0

| accepted

Answered

Function handles and passing parameters to ode solver

Like this: c_h = ... some value; c_v = ... some value; ... all the others variables myTorque = ... some value; % Now define...

Function handles and passing parameters to ode solver

Like this: c_h = ... some value; c_v = ... some value; ... all the others variables myTorque = ... some value; % Now define...

7 days ago | 0

| accepted

Answered

Write matrix or array without overwriting

You are mixing up two different approaches to adding data in a loop: concatenation and indexing. Just pick one, e.g.: A = [A;te...

Write matrix or array without overwriting

You are mixing up two different approaches to adding data in a loop: concatenation and indexing. Just pick one, e.g.: A = [A;te...

7 days ago | 0

Answered

How to create a vector, knowing start, increment and number of values.

B = 6.333954480229592e-06; I = 3.906250000000000e-05; N = 537600; V = B + I*(0:N-1);

How to create a vector, knowing start, increment and number of values.

B = 6.333954480229592e-06; I = 3.906250000000000e-05; N = 537600; V = B + I*(0:N-1);

7 days ago | 0

| accepted

Answered

Appending data in multiple structures using a loop

D = 'absolute/relative path to where the files are saved'; S = dir(fullfile(D,'*.mat')); N = numel(S); for k = 1:N F = f...

Appending data in multiple structures using a loop

D = 'absolute/relative path to where the files are saved'; S = dir(fullfile(D,'*.mat')); N = numel(S); for k = 1:N F = f...

8 days ago | 0

Answered

Cell Array always includes a period as its first value

"So, why does fileinfo.name return those first 3 columns, and how can I get rid of them?" Because DIR returns exactly what the ...

Cell Array always includes a period as its first value

"So, why does fileinfo.name return those first 3 columns, and how can I get rid of them?" Because DIR returns exactly what the ...

8 days ago | 0

| accepted

Answered

How to use index for structure within for loop?

Using numbered variable names is a sign that you are doing something wrong. The simple and efficient approach is to use one non...

How to use index for structure within for loop?

Using numbered variable names is a sign that you are doing something wrong. The simple and efficient approach is to use one non...

8 days ago | 0

Answered

Why \n or newline doesn't work ?

"Do someone know why ?" The documentation states "For character array inputs, strcat removes trailing ASCII white-space charact...

Why \n or newline doesn't work ?

"Do someone know why ?" The documentation states "For character array inputs, strcat removes trailing ASCII white-space charact...

8 days ago | 0

| accepted

Answered

Access multiple structure fields and put them in a new structure or vector

No, what you are asking for is not possible. This syntax: dataArray{1,2:10} creates a comma-separated list of separate arrays,...

Access multiple structure fields and put them in a new structure or vector

No, what you are asking for is not possible. This syntax: dataArray{1,2:10} creates a comma-separated list of separate arrays,...

10 days ago | 0

| accepted

Answered

Append to vector of different sizes in for loop

Simpler: S = load('test_file.mat') fun = @(b,e)S.TimeSeries_short(b:e); out = arrayfun(fun,S.ipts(1:2:end),S.ipts(2:2:end),'u...

Append to vector of different sizes in for loop

Simpler: S = load('test_file.mat') fun = @(b,e)S.TimeSeries_short(b:e); out = arrayfun(fun,S.ipts(1:2:end),S.ipts(2:2:end),'u...

10 days ago | 0

| accepted

Answered

i have loop and i need to Create a table for each loop

Use indexing rather than numbering the variables: N = the number of tables that you want C = cell(1,N); for k = 1:N C{k} ...

i have loop and i need to Create a table for each loop

Use indexing rather than numbering the variables: N = the number of tables that you want C = cell(1,N); for k = 1:N C{k} ...

10 days ago | 0

| accepted

Answered

How can I find the difference between adjacent elements while ignoring the first value?

diff(data(2:end))

How can I find the difference between adjacent elements while ignoring the first value?

diff(data(2:end))

10 days ago | 0

| accepted

Answered

how to append matrix in a loop

s1 = [1,0,1,1,0]; s2 = [2,4,3,1,2]; v = repelem(s1,s2)

how to append matrix in a loop

s1 = [1,0,1,1,0]; s2 = [2,4,3,1,2]; v = repelem(s1,s2)

11 days ago | 0

Answered

How to combine to identical 'for' loops with sequential varying variables ?

Numbering variables like that is completely the wrong approach and should be avoided. One better approach is to use a container...

How to combine to identical 'for' loops with sequential varying variables ?

Numbering variables like that is completely the wrong approach and should be avoided. One better approach is to use a container...

11 days ago | 0

| accepted