Suspensa Vix Via Fit

Answered

Can't seem to understand what my mistake is (Loading .mat files)

The bug is very simple: your code refers to q_Theta_y but the variable in the mat file is named q_Theta_Y You need to use th...

Can't seem to understand what my mistake is (Loading .mat files)

The bug is very simple: your code refers to q_Theta_y but the variable in the mat file is named q_Theta_Y You need to use th...

alrededor de 4 horas ago | 1

| accepted

Answered

Numeric extract from char

>> regexp('("Acb2hea" == 10)','\<\d+\>','match') ans = '10' >> regexp('("Acb2hea1" >= 15)','\<\d+\>','match') ans = ...

Numeric extract from char

>> regexp('("Acb2hea" == 10)','\<\d+\>','match') ans = '10' >> regexp('("Acb2hea1" >= 15)','\<\d+\>','match') ans = ...

alrededor de 10 horas ago | 0

Answered

How to compute the mean of several matrices in a cell?

Just for fun, if your memory can handle it: A = mean(permute(cell2mat(reshape(M_one,1,1,3,[])),[1,2,4,3]),4) For matrices of t...

How to compute the mean of several matrices in a cell?

Just for fun, if your memory can handle it: A = mean(permute(cell2mat(reshape(M_one,1,1,3,[])),[1,2,4,3]),4) For matrices of t...

1 día ago | 0

| accepted

Answered

Mean Value of Cell array having uneven vector

>> C = {[0,1,2,3],[4,5];[6,7,8],9}; >> S = size(C); >> M = nan(S(1),max(cellfun(@length,C)),S(2)); >> for k1=1:S(1), for k2=1...

Mean Value of Cell array having uneven vector

>> C = {[0,1,2,3],[4,5];[6,7,8],9}; >> S = size(C); >> M = nan(S(1),max(cellfun(@length,C)),S(2)); >> for k1=1:S(1), for k2=1...

1 día ago | 0

Answered

How to declare above type of variable in MATLAB?

"How can I declare the above type of variable before hand and fill up the numbers in loop?" n = cell(1,9); for k = 1:9 n{...

How to declare above type of variable in MATLAB?

"How can I declare the above type of variable before hand and fill up the numbers in loop?" n = cell(1,9); for k = 1:9 n{...

1 día ago | 0

| accepted

Answered

Return multiple results from a function in one variable

"I have a function called "ols2" that calculates 12 different values. Is there some way I can call the function program without ...

Return multiple results from a function in one variable

"I have a function called "ols2" that calculates 12 different values. Is there some way I can call the function program without ...

1 día ago | 0

Answered

Writing Functions that take inputs?

"When I run the code nothing happens expect the prompts asking me for data." You defined a function in a script (which is permi...

Writing Functions that take inputs?

"When I run the code nothing happens expect the prompts asking me for data." You defined a function in a script (which is permi...

1 día ago | 1

Answered

Dot Product Doubt, don't get the result I expected.

You are using the wrong operator. You need basic matrix multiplication, not the dot product: >> q1 = [0;0;0.2]; >> q1.'*q1 an...

Dot Product Doubt, don't get the result I expected.

You are using the wrong operator. You need basic matrix multiplication, not the dot product: >> q1 = [0;0;0.2]; >> q1.'*q1 an...

3 días ago | 2

| accepted

Answered

fprintf columns turning out weirdly

"Why would It print like this..." Because that is exactly what you told fprintf to do: your fprintf format string has six forma...

fprintf columns turning out weirdly

"Why would It print like this..." Because that is exactly what you told fprintf to do: your fprintf format string has six forma...

3 días ago | 0

| accepted

Answered

convert binary to hex

>> B = '111000111100110011111001000000111101000000000111111110001111001100111110010000001111010000000001111111100011110011001111...

convert binary to hex

>> B = '111000111100110011111001000000111101000000000111111110001111001100111110010000001111010000000001111111100011110011001111...

3 días ago | 0

| accepted

Answered

how to clip column into vectors with the rules I set

>> [~,~,idx] = unique(floor(A(:,1)/10)); >> out = accumarray(idx,A(:,2),[],@(v){v}); >> out{1} ans = 0.3000 0.8000 ...

how to clip column into vectors with the rules I set

>> [~,~,idx] = unique(floor(A(:,1)/10)); >> out = accumarray(idx,A(:,2),[],@(v){v}); >> out{1} ans = 0.3000 0.8000 ...

8 días ago | 2

Answered

Floor function with a space giving an array output

Your example uses command syntax, which is explained here: https://www.mathworks.com/help/matlab/matlab_prog/command-vs-functio...

Floor function with a space giving an array output

Your example uses command syntax, which is explained here: https://www.mathworks.com/help/matlab/matlab_prog/command-vs-functio...

8 días ago | 0

| accepted

Answered

How to interpret entries in documentation's left pane

"What do the entries below that represent?" They list all other page headings that are at the same level in the current Content...

How to interpret entries in documentation's left pane

"What do the entries below that represent?" They list all other page headings that are at the same level in the current Content...

8 días ago | 1

| accepted

Answered

How to use regexp to extract data?

>> tdata = {'XX__TG';'GB_TH';'BN__TH'}; >> spl = regexp(tdata,'_+','split'); >> spl = vertcat(spl{:}); >> out1 = spl(:,1) ou...

How to use regexp to extract data?

>> tdata = {'XX__TG';'GB_TH';'BN__TH'}; >> spl = regexp(tdata,'_+','split'); >> spl = vertcat(spl{:}); >> out1 = spl(:,1) ou...

8 días ago | 0

| accepted

Answered

Why am I warned about defining variables in a nested function, when I don't?

So far no one has actually explained the warning, which is a pity because this is really quite an interesting question. Some an...

Why am I warned about defining variables in a nested function, when I don't?

So far no one has actually explained the warning, which is a pity because this is really quite an interesting question. Some an...

8 días ago | 3

Answered

How do I swap the elements in the major diagonal with those in the minor diagonal?

Similar to madhan ravi's answer, without sorting: >> x = [1,2,3,4,5;6,7,8,9,1;2,3,4,5,6;7,8,9,1,2] x = 1 2 3 4 5 ...

How do I swap the elements in the major diagonal with those in the minor diagonal?

Similar to madhan ravi's answer, without sorting: >> x = [1,2,3,4,5;6,7,8,9,1;2,3,4,5,6;7,8,9,1,2] x = 1 2 3 4 5 ...

9 días ago | 2

Answered

Removing the max and min of a vector without removing multiple minimums or maximums

[~,Sx] = min(a1); % Shortest Link [~,Lx] = max(a1); % Longest Link a2 = a1; a2([Sx,Lx]) = [] And tested using the values tha...

Removing the max and min of a vector without removing multiple minimums or maximums

[~,Sx] = min(a1); % Shortest Link [~,Lx] = max(a1); % Longest Link a2 = a1; a2([Sx,Lx]) = [] And tested using the values tha...

9 días ago | 1

| accepted

Answered

How to import data with exotic delimiters.

Using textscan's optional arguments properly avoids awkward reshaping of the output (and you have more flexibility because you c...

How to import data with exotic delimiters.

Using textscan's optional arguments properly avoids awkward reshaping of the output (and you have more flexibility because you c...

9 días ago | 0

Answered

How to save multiple text files with same name, but with incrementing numbers

"The function I'm using, writetable, requires to specify the filename between apostrophes..." Actually the writetable documenta...

How to save multiple text files with same name, but with incrementing numbers

"The function I'm using, writetable, requires to specify the filename between apostrophes..." Actually the writetable documenta...

10 días ago | 0

Answered

Automatically naming mat files with variable names

The cause of your difficulties lies in the unfortunate design decision to force meta-data into the variable names. Meta-data is ...

Automatically naming mat files with variable names

The cause of your difficulties lies in the unfortunate design decision to force meta-data into the variable names. Meta-data is ...

10 días ago | 1

| accepted

Answered

How can I merge rows into one with the same ID number?

Assuming that the non-diagonal values are exactly zero, then you could use varfun something like this: >> T = cell2table({'A',1...

How can I merge rows into one with the same ID number?

Assuming that the non-diagonal values are exactly zero, then you could use varfun something like this: >> T = cell2table({'A',1...

10 días ago | 0

Answered

Storing the generated matrices from a for loop into cell arrays and access them later to multiply them altogether

No cell array required: >> x = [2,5,23]; >> A = [9,8;7,6]; >> [n,n] = size(A); >> M = 1; >> for k=numel(x):-1:1; M = M*(A-x...

Storing the generated matrices from a for loop into cell arrays and access them later to multiply them altogether

No cell array required: >> x = [2,5,23]; >> A = [9,8;7,6]; >> [n,n] = size(A); >> M = 1; >> for k=numel(x):-1:1; M = M*(A-x...

13 días ago | 0

Answered

Example got removed from the mathworks website

Unfortunately the Wayback Machine did not seem to have a copy of it, but it was still available in Google Cache, so I saved you ...

Example got removed from the mathworks website

Unfortunately the Wayback Machine did not seem to have a copy of it, but it was still available in Google Cache, so I saved you ...

14 días ago | 1

| accepted

Answered

Substitute string to double

>> A = {'0+1/R1','0-1/R1','1';'0-1/R1','0+1/R1+1/R2','0';'1','0','0'}; >> A = strrep(A,'R1','1000'); >> A = strrep(A,'R2','100...

Substitute string to double

>> A = {'0+1/R1','0-1/R1','1';'0-1/R1','0+1/R1+1/R2','0';'1','0','0'}; >> A = strrep(A,'R1','1000'); >> A = strrep(A,'R2','100...

14 días ago | 0

| accepted

Answered

i want to write a code where equation is y=x*x. if y=100 what is the value of x?

>> f = @(x) x.^2 - 100; >> x = fzero(f,pi) x = 10

i want to write a code where equation is y=x*x. if y=100 what is the value of x?

>> f = @(x) x.^2 - 100; >> x = fzero(f,pi) x = 10

14 días ago | 0

| accepted

Answered

delete column from matrix

Where M is your matrix: M = M(:,24:24:end)

delete column from matrix

Where M is your matrix: M = M(:,24:24:end)

14 días ago | 0

| accepted

Answered

How can I differentiate between powermod(a,b,c) and mod(a^b,c)

>> 104^45 ans = 5.8412e+90 is well above flintmax, so it is very unlikely to exactly represent the integer that you think ...

How can I differentiate between powermod(a,b,c) and mod(a^b,c)

>> 104^45 ans = 5.8412e+90 is well above flintmax, so it is very unlikely to exactly represent the integer that you think ...

15 días ago | 0

Answered

matrix creation from a loop

The simplest and most efficient solution is to just create one matrix: lat = zeros(6964,60) which you can then trivially acces...

matrix creation from a loop

The simplest and most efficient solution is to just create one matrix: lat = zeros(6964,60) which you can then trivially acces...

15 días ago | 1

Answered

How can I index a 3D array like A(n,m,:) and get the result as a 1D array?

B = reshape(A(2,3,:),1,[])

How can I index a 3D array like A(n,m,:) and get the result as a 1D array?

B = reshape(A(2,3,:),1,[])

15 días ago | 0

| accepted