Answered

Error using pwelch - Expected x to be finite.

x=load('\\fs01.hpc.unipr.it\bonini01\WIRELESS_Wifi_Router_Impianti2021\Acquisizioni Deuteron\ProvaHyper_20220915_M1\LFP1.mat'); ...

Error using pwelch - Expected x to be finite.

x=load('\\fs01.hpc.unipr.it\bonini01\WIRELESS_Wifi_Router_Impianti2021\Acquisizioni Deuteron\ProvaHyper_20220915_M1\LFP1.mat'); ...

ongeveer 2 maanden ago | 0

| accepted

Answered

Sum of columns in a mxn Matrix on matlab

s=column_sum(A,cl+1); Will crash if pass cl > size(A,1) as there's no error checking for cl being out of range. As for the...

Sum of columns in a mxn Matrix on matlab

s=column_sum(A,cl+1); Will crash if pass cl > size(A,1) as there's no error checking for cl being out of range. As for the...

ongeveer 2 maanden ago | 0

Answered

Save a stream of bytes into a zip file

PKZip was/is shareware, it should be possible to turn the code for it into a callable mex file that works from memory; it's quit...

Save a stream of bytes into a zip file

PKZip was/is shareware, it should be possible to turn the code for it into a callable mex file that works from memory; it's quit...

ongeveer 2 maanden ago | 0

| accepted

Answered

How to extrapolate an x value from a fitting curve?

xvalues = [10; 12; 22; 28]; yvalues = [1; 2; 3; 4]; % Fit model to data. [fitresult, gof] = fit( xvalues, yvalues, 'linearint...

How to extrapolate an x value from a fitting curve?

xvalues = [10; 12; 22; 28]; yvalues = [1; 2; 3; 4]; % Fit model to data. [fitresult, gof] = fit( xvalues, yvalues, 'linearint...

ongeveer 2 maanden ago | 0

Answered

Data in multiple separate .xlsx sheets and move to only one .xlsx sheet

%fn=websave('cpc_global_precip_precip.2020.xlsx','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1166433/cpc_glo...

Data in multiple separate .xlsx sheets and move to only one .xlsx sheet

%fn=websave('cpc_global_precip_precip.2020.xlsx','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1166433/cpc_glo...

ongeveer 2 maanden ago | 0

Answered

plotting an array in frequency domain

L=numel(t); % how long is t vector??? f = Fs*(0:L-1); % zero-based frequency of same number elements NOTA BENE:: T...

plotting an array in frequency domain

L=numel(t); % how long is t vector??? f = Fs*(0:L-1); % zero-based frequency of same number elements NOTA BENE:: T...

ongeveer 2 maanden ago | 0

| accepted

Answered

How to run an external Matlab(.m) files and call its functions from an application code-view file?

See <class-definition-and-organization> area in the docs -- you package your classes so your application can import them and the...

How to run an external Matlab(.m) files and call its functions from an application code-view file?

See <class-definition-and-organization> area in the docs -- you package your classes so your application can import them and the...

ongeveer 2 maanden ago | 1

| accepted

Answered

How to fix error about interp1?

From the description it appears you have only 5 unique values in wdepth(:,1). As the doc and the error message say, interp1 can...

How to fix error about interp1?

From the description it appears you have only 5 unique values in wdepth(:,1). As the doc and the error message say, interp1 can...

ongeveer 2 maanden ago | 0

Answered

Vectorize for-loop with indexing

S=accumarray(idx(:),B(:)); See accumarray for all the many permutations that can be made... An alternative using grouping va...

Vectorize for-loop with indexing

S=accumarray(idx(:),B(:)); See accumarray for all the many permutations that can be made... An alternative using grouping va...

ongeveer 2 maanden ago | 1

| accepted

Answered

how to delete decimal places

'Pends. You mean just at the display or in the actual data? If it's for the display, there isn't an "integer" format option; '...

how to delete decimal places

'Pends. You mean just at the display or in the actual data? If it's for the display, there isn't an "integer" format option; '...

ongeveer 2 maanden ago | 0

| accepted

Answered

Specify output data type of "find" function

" Is there something akin to the "like" functionality [in find]...?" No. Everything numeric including indices in MATLAB is a d...

Specify output data type of "find" function

" Is there something akin to the "like" functionality [in find]...?" No. Everything numeric including indices in MATLAB is a d...

ongeveer 2 maanden ago | 1

| accepted

Answered

Replace String in Table if Substring is Found

id=["Broken statuette", "Terracotta statuette","Statuette"]; % the variable valset=[id,"Other Stuff"]; ...

Replace String in Table if Substring is Found

id=["Broken statuette", "Terracotta statuette","Statuette"]; % the variable valset=[id,"Other Stuff"]; ...

ongeveer 2 maanden ago | 0

Answered

How to calculate the daily and yearly mean of a temperature dataset

Read as timetable and then use retime. About 2-3 lines of code each should do it.

How to calculate the daily and yearly mean of a temperature dataset

Read as timetable and then use retime. About 2-3 lines of code each should do it.

ongeveer 2 maanden ago | 1

Answered

What codes do I have to use to determine if the data are Gaussian distributed?

MATLAB implements jbtest and adtest in the Statistics TB. My personal preference is to use the Shapiro-Wilk test. See <NIST Ha...

What codes do I have to use to determine if the data are Gaussian distributed?

MATLAB implements jbtest and adtest in the Statistics TB. My personal preference is to use the Shapiro-Wilk test. See <NIST Ha...

ongeveer 2 maanden ago | 1

| accepted

Answered

Bar to variation a parameter into script

No real idea what the above is asking for, specifically, but... V=[0.15;500;21]; Y=categorical({'kp','ki','kd'}); barh(Y,V,0....

Bar to variation a parameter into script

No real idea what the above is asking for, specifically, but... V=[0.15;500;21]; Y=categorical({'kp','ki','kd'}); barh(Y,V,0....

ongeveer 2 maanden ago | 0

Answered

Timeline plot of GPS (Latitude and Longitude) data - Plot GPS overtime.

tT.Time=datetime(tT.Year, tT.Month, tT.Day, tT.Hour, tT.Minute, tT.Sec); plot(tT.Time, tT{:,{'Latitude', 'Longitude', 'Altitude...

Timeline plot of GPS (Latitude and Longitude) data - Plot GPS overtime.

tT.Time=datetime(tT.Year, tT.Month, tT.Day, tT.Hour, tT.Minute, tT.Sec); plot(tT.Time, tT{:,{'Latitude', 'Longitude', 'Altitude...

ongeveer 2 maanden ago | 0

| accepted

Answered

How to use a vector as an input in a function?

Carrying on from @Matt's comment above... Is it really going to be more convenient to assemble all the elements into one long v...

How to use a vector as an input in a function?

Carrying on from @Matt's comment above... Is it really going to be more convenient to assemble all the elements into one long v...

ongeveer 2 maanden ago | 1

| accepted

Answered

Automatic Adjusting of xticks depending of data

categorical axes are somewhat peculiar -- the categorical variable always contains all the categories for which it was created a...

Automatic Adjusting of xticks depending of data

categorical axes are somewhat peculiar -- the categorical variable always contains all the categories for which it was created a...

ongeveer 2 maanden ago | 0

| accepted

Answered

How to save and read a 3D matrix in MATLAB?

"readmatrix(filename) creates an array by reading column-oriented data..." A matrix in MATLAB is 2D; writematrix writes the pla...

How to save and read a 3D matrix in MATLAB?

"readmatrix(filename) creates an array by reading column-oriented data..." A matrix in MATLAB is 2D; writematrix writes the pla...

ongeveer 2 maanden ago | 0

Answered

textscan doesn't stop at blank space in txt file

opt=detectImportOptions(websave('walking_01.txt','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1163318/walking...

textscan doesn't stop at blank space in txt file

opt=detectImportOptions(websave('walking_01.txt','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1163318/walking...

ongeveer 2 maanden ago | 0

Answered

Matlab plot not showing correct values

No need for and don't use loops here... p=[0.1553567,-2.0416,9.1837,-14.829,-1.3703,32.821,-1.3155]; % store poly coefficien...

Matlab plot not showing correct values

No need for and don't use loops here... p=[0.1553567,-2.0416,9.1837,-14.829,-1.3703,32.821,-1.3155]; % store poly coefficien...

ongeveer 2 maanden ago | 0

Answered

How can I find X for given Y value in a fitted curve. I have a non- linear equation of 6th order.

"ALWAYS" plot your equation first -- fnY=@(X)0.0178*(X.^6) -0.3463*(X.^5) + 2.6845*(X.^4) -10.426*(X.^3) + 21.192*(X.^2) -20.64...

How can I find X for given Y value in a fitted curve. I have a non- linear equation of 6th order.

"ALWAYS" plot your equation first -- fnY=@(X)0.0178*(X.^6) -0.3463*(X.^5) + 2.6845*(X.^4) -10.426*(X.^3) + 21.192*(X.^2) -20.64...

ongeveer 2 maanden ago | 0

Answered

Speed up vectorized code automatic expansion logical indexing

function F = myfun(l,aprime,a_val,z_val) aux = 3.5; cons = a_val+l*z_val - aprime; F=-inf(size(cons)); indx=c...

Speed up vectorized code automatic expansion logical indexing

function F = myfun(l,aprime,a_val,z_val) aux = 3.5; cons = a_val+l*z_val - aprime; F=-inf(size(cons)); indx=c...

ongeveer 2 maanden ago | 0

| accepted

Answered

Calculating mean and std from every continuous variable in a table

vartype to the rescue...for the base case of numeric S = vartype('numeric'); % create the indexing variable by...

Calculating mean and std from every continuous variable in a table

vartype to the rescue...for the base case of numeric S = vartype('numeric'); % create the indexing variable by...

ongeveer 2 maanden ago | 0

| accepted

Answered

Finding column values for each unique combination of two other columnar values in a table

% build a dataset XYZ=randi(1000,30,3); U=arrayfun(@(i)unique(XYZ(:,i)),1:3,'uni',0); N=min(cellfun(@numel,U)); tXYZ=array2t...

Finding column values for each unique combination of two other columnar values in a table

% build a dataset XYZ=randi(1000,30,3); U=arrayfun(@(i)unique(XYZ(:,i)),1:3,'uni',0); N=min(cellfun(@numel,U)); tXYZ=array2t...

ongeveer 2 maanden ago | 0

Answered

How to make a normal distribution using the following parameters: mean, standard error, minimum, and maximum?

" have a standard error value of 0.05." I have always heard "standard error" as being the std/mean -- using 0.05 as the standar...

How to make a normal distribution using the following parameters: mean, standard error, minimum, and maximum?

" have a standard error value of 0.05." I have always heard "standard error" as being the std/mean -- using 0.05 as the standar...

ongeveer 2 maanden ago | 0

Answered

How to split an array cell with multiple text line with carriage return

We can't test without actual data sample to be sure what is actually embedded in the string, but if it's using standard whitesp...

How to split an array cell with multiple text line with carriage return

We can't test without actual data sample to be sure what is actually embedded in the string, but if it's using standard whitesp...

ongeveer 2 maanden ago | 0

Answered

How do i merge multiple columns in a table into one?

See mergevars -- MATLAB has anticipated your every desire... :)

How do i merge multiple columns in a table into one?

See mergevars -- MATLAB has anticipated your every desire... :)

ongeveer 2 maanden ago | 0

Answered

Using cellfun to remove nans from uniform cell

If they are and always will be the same size, I'd use subterfuge... [ra,ca]=size(R{1}); % save the array sizes firs...

Using cellfun to remove nans from uniform cell

If they are and always will be the same size, I'd use subterfuge... [ra,ca]=size(R{1}); % save the array sizes firs...

ongeveer 2 maanden ago | 0

| accepted