Suspensa Vix Via Fit

Answered

Assign values of .mat files into matrix

D = 'path to the folder where the files are saved'; S = dir(fullfile(D,'silomodresults*.mat')); C = {}; for k = 1:numel(S) ...

Assign values of .mat files into matrix

D = 'path to the folder where the files are saved'; S = dir(fullfile(D,'silomodresults*.mat')); C = {}; for k = 1:numel(S) ...

10 hours ago | 0

Answered

Splitting an array up

Just use mat2cell, no need for reshape: >> M = rand(64,92690); % fake data >> N = 2048; >> S = size(M); >> V = repmat(N,1,fi...

Splitting an array up

Just use mat2cell, no need for reshape: >> M = rand(64,92690); % fake data >> N = 2048; >> S = size(M); >> V = repmat(N,1,fi...

15 hours ago | 2

Answered

Subtraction inside a cell array

You will have to get the numeric data out of the cell array before performing any numeric operations on it. Although you did no...

Subtraction inside a cell array

You will have to get the numeric data out of the cell array before performing any numeric operations on it. Although you did no...

18 hours ago | 0

Answered

How to combine the multiple .mat files of ecg to get a single file.

This should get you started: D = 'path to the folder where the files are saved'; S = dir(fullfile(D,'*.mat')); for k = 1:nume...

How to combine the multiple .mat files of ecg to get a single file.

This should get you started: D = 'path to the folder where the files are saved'; S = dir(fullfile(D,'*.mat')); for k = 1:nume...

20 hours ago | 0

Answered

Plot function with varying variable

The MATLAB approach is to use logical indexing, e.g.: z = 0:0.1:5; y = 2; f = z*y; idx = z>1; % logical index f(idx) = 2*z(...

Plot function with varying variable

The MATLAB approach is to use logical indexing, e.g.: z = 0:0.1:5; y = 2; f = z*y; idx = z>1; % logical index f(idx) = 2*z(...

22 hours ago | 0

Answered

Sorting of points in 2D

Here is some simple code that that works quite nicely for your aerofoil. The code assumes that the top and bottom are both funct...

Sorting of points in 2D

Here is some simple code that that works quite nicely for your aerofoil. The code assumes that the top and bottom are both funct...

2 days ago | 1

| accepted

Answered

Why MATLAB asks for "more input arguments" in the function which is to be handled by ode45?

"However, exactly this is the syntax in the MATLAB documentation" I very much doubt that the MATLAB documentation shows any rec...

Why MATLAB asks for "more input arguments" in the function which is to be handled by ode45?

"However, exactly this is the syntax in the MATLAB documentation" I very much doubt that the MATLAB documentation shows any rec...

2 days ago | 0

| accepted

Answered

How to only replot part of a graph?

"Is there a way to only replot the changed point and the curve around it," Yes: you just need to change the XData and YData val...

How to only replot part of a graph?

"Is there a way to only replot the changed point and the curve around it," Yes: you just need to change the XData and YData val...

2 days ago | 0

Answered

floating point arithmetics, mathlab's interpretation of a . after a number

"Why doesn't e yield 0?" Because most of your values cannot be exactly represented using binary floating point numbers. The va...

floating point arithmetics, mathlab's interpretation of a . after a number

"Why doesn't e yield 0?" Because most of your values cannot be exactly represented using binary floating point numbers. The va...

3 days ago | 1

| accepted

Answered

How to create arrays from repeated matrix raws?

>> A = [1,2,3,4,5;1,2,8,9,10;1,2,13,14,15;11,12,16,27,18;11,12,19,29,21;11,12,22,23,24] A = 1 2 3 4 5 1 ...

How to create arrays from repeated matrix raws?

>> A = [1,2,3,4,5;1,2,8,9,10;1,2,13,14,15;11,12,16,27,18;11,12,19,29,21;11,12,22,23,24] A = 1 2 3 4 5 1 ...

4 days ago | 1

| accepted

Answered

Automatically Update Plots on GUI With Multiple Sliders

One simple approach is to have one "update" function in your GUI and call it from each individual callback: function slider1Cal...

Automatically Update Plots on GUI With Multiple Sliders

One simple approach is to have one "update" function in your GUI and call it from each individual callback: function slider1Cal...

4 days ago | 2

| accepted

Answered

Sort() function return wrong values

You are not assigning the sorted matrix to anything. You need to assign it to a variable, e.g.: minCell = minCell(s, :);

Sort() function return wrong values

You are not assigning the sorted matrix to anything. You need to assign it to a variable, e.g.: minCell = minCell(s, :);

4 days ago | 0

| accepted

Answered

Find index of element closest to other index

>> B1 = [0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1] B1 = 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 >> B2 = [1,1,...

Find index of element closest to other index

>> B1 = [0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1] B1 = 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 >> B2 = [1,1,...

5 days ago | 0

| accepted

Answered

How to read multiple image directory with for loop

Rather than fragile string concatenation and ungainly constructs involving int2str or num2str, the neat and efficient MATLAB app...

How to read multiple image directory with for loop

Rather than fragile string concatenation and ungainly constructs involving int2str or num2str, the neat and efficient MATLAB app...

5 days ago | 1

Answered

how to get the memory address of variable in matlab

Undocumented feature, has been around for many versions: format debug Examples of its usage: https://www.mathworks.com/matlab...

how to get the memory address of variable in matlab

Undocumented feature, has been around for many versions: format debug Examples of its usage: https://www.mathworks.com/matlab...

5 days ago | 0

Answered

How to check if a element of a struct is empty?

fun = @(s) all(structfun(@isempty,s)); % check the fields of a scalar structure. idx = arrayfun(fun,Res_All_Meas); % indices of...

How to check if a element of a struct is empty?

fun = @(s) all(structfun(@isempty,s)); % check the fields of a scalar structure. idx = arrayfun(fun,Res_All_Meas); % indices of...

5 days ago | 0

Answered

How to rename an image after processing with different parameters

The cause of the problem is that your inner loop repeatedly processes the same string of the cell array Outputs. So you just kee...

How to rename an image after processing with different parameters

The cause of the problem is that your inner loop repeatedly processes the same string of the cell array Outputs. So you just kee...

5 days ago | 0

| accepted

Answered

how to calculate mean of submatrices in a large matrix and print out a new matrix

>> M = [11,12,13,14;21,22,23,24;31,32,33,34;41,42,43,44;51,52,53,54;61,62,63,64] M = 11 12 13 14 21 22 23 2...

how to calculate mean of submatrices in a large matrix and print out a new matrix

>> M = [11,12,13,14;21,22,23,24;31,32,33,34;41,42,43,44;51,52,53,54;61,62,63,64] M = 11 12 13 14 21 22 23 2...

5 days ago | 0

| accepted

Answered

How to effectively check a list of variables for existence and then check "isvector"

"The data are loaded from "mat" files, some may exist but some may not." Once those .mat files are already loaded directly into...

How to effectively check a list of variables for existence and then check "isvector"

"The data are loaded from "mat" files, some may exist but some may not." Once those .mat files are already loaded directly into...

5 days ago | 0

Answered

Function is not working

The basic problem is that you keep repeating the same indexing, e.g.: resp = responses(targets==target); .. err = resp(target...

Function is not working

The basic problem is that you keep repeating the same indexing, e.g.: resp = responses(targets==target); .. err = resp(target...

6 days ago | 0

Answered

Extracting Data to a workspace

The MATLAB approach: >> [X,Y] = meshgrid(0:3,0:2); >> A = X+Y; >> M = [X(:),Y(:),A(:)] M = 0 0 0 0 1 1 0...

Extracting Data to a workspace

The MATLAB approach: >> [X,Y] = meshgrid(0:3,0:2); >> A = X+Y; >> M = [X(:),Y(:),A(:)] M = 0 0 0 0 1 1 0...

6 days ago | 0

| accepted

Answered

Creating a Matrix from a nesting For loop

The MATLAB approach: >> [Xm,Ym] = meshgrid(1:25,1:25); >> Zm = Xm.*Ym; >> surf(Xm,Ym,Zm) Giving:

Creating a Matrix from a nesting For loop

The MATLAB approach: >> [Xm,Ym] = meshgrid(1:25,1:25); >> Zm = Xm.*Ym; >> surf(Xm,Ym,Zm) Giving:

7 days ago | 0

| accepted

Answered

Problem with plotting vector fields

"also the figure I get comes out to be emtpy" You need to use array operations, not matrix operations: >> [X,Y] = meshgrid(2:1...

Problem with plotting vector fields

"also the figure I get comes out to be emtpy" You need to use array operations, not matrix operations: >> [X,Y] = meshgrid(2:1...

7 days ago | 0

| accepted

Answered

Passing Structure Array of Parameters into Boundary Condition Function for PDEPE

You need to parameterize the function: https://www.mathworks.com/help/matlab/math/parameterizing-functions.html Usually the si...

Passing Structure Array of Parameters into Boundary Condition Function for PDEPE

You need to parameterize the function: https://www.mathworks.com/help/matlab/math/parameterizing-functions.html Usually the si...

7 days ago | 0

| accepted

Answered

Not enough input arguments

There are two main bugs that we need to fix: define the correct function outputs. call the function with input and output argu...

Not enough input arguments

There are two main bugs that we need to fix: define the correct function outputs. call the function with input and output argu...

7 days ago | 0

Answered

How to modify field any levels deep in a structure with a string

"i cant break the string into its fields and use something like app.(str1).(str2).str(3)..." You cannot use dynamic fieldnames ...

How to modify field any levels deep in a structure with a string

"i cant break the string into its fields and use something like app.(str1).(str2).str(3)..." You cannot use dynamic fieldnames ...

7 days ago | 0

| accepted

Answered

check if an array is equispaced

>> v = [1,2,3,4,5,6,7]; >> x = ~any(diff(v,2)) x = 1 >> v = [1,2,4,4.5,7]; >> x = ~any(diff(v,2)) x = 0

check if an array is equispaced

>> v = [1,2,3,4,5,6,7]; >> x = ~any(diff(v,2)) x = 1 >> v = [1,2,4,4.5,7]; >> x = ~any(diff(v,2)) x = 0

8 days ago | 1

Answered

Regular expressions: extracting data after certain keywords

For such a large file I would get textscan to directly import the numeric data. With a few simple file commands you can also aut...

Regular expressions: extracting data after certain keywords

For such a large file I would get textscan to directly import the numeric data. With a few simple file commands you can also aut...

8 days ago | 0

| accepted