How can I augment a toolbox to improve its capabilities?
Don't have the TB in Q? so can't go look to see, but if it is an m-file, there are two ways -- you can just edit the copy in pla...

12 days ago | 0

making a vector of cells
Probably good choice would be to convert the country string/column in the table into a categorical variable; makes for looking f...

13 days ago | 1

| accepted

14 days ago | 1

How can i fix this error?
NB the following ouput: Input data successfully read. Time Series data divided to 80% Train data and 20% Test data Time Serie...

14 days ago | 0

How to read a .txt file in matlab ?
The file is irregular -- there are 9 elements in first record and only eight (8) in second. Besides that, they're inconsistent ...

15 days ago | 1

| accepted

split wav file based on txt file (two vectors - start time and duration)
That only would take basic math operations to turn the start times and durations into indices into the the .wav file based on th...

15 days ago | 1

How can i multiply every row to row values?
>> A=reshape(1:9,3,[]) A = 1.00 4.00 7.00 2.00 5.00 8.00 3...

16 days ago | 0

| accepted

How can I calculate Kurtosis of Sound data?
Kin=arrayfun(@(i1,i2)kurtosis(X(i1:i2)),iStart,iEnd); where X are your data and the two indexing arrays above for the "in group...

16 days ago | 0

Plotting data from struct
Couple ways of many... XY=reshape([pop.Cost],2,[]).'; plot(XY(:,1),XY(:,2)) or tpop=struct2table(pop); plot(tpop.Cost(:,1),...

18 days ago | 2

| accepted

How to create code that runs on all columns?
"I have a data set of 10583x3352 single ... I need to averge every 167 rows into 1 row for every column." N=167; ...

18 days ago | 1

| accepted

Creating new vectors containing values based on for loop outcome.
vals=interp1(a,a,b,'nearest','extrap'); For above a,b: >> vals vals = 3520.00 7650.00 7650.00 1250....

19 days ago | 0

| accepted

Normalization of Power Spectral Density
It's to make the output amplitude consistent regardless of the frequency resolution of the measurement. See https://community.s...

19 days ago | 1

How can I correctly use the parenthesis and write equations
Pd=Pc*((1+(k-1)/2*ac^2*Vpr^2)^(k/(K-1))-1); Which inputs might be vectors, if any, would determine where and if need dot operat...

20 days ago | 0

How do I make a histogram using value - count pairs?
histogram('categories',categorical(M(:,1)),'bincounts',M(:,2)) to match the number of elements in x,y. Otherwise, have to ...

20 days ago | 2

| accepted

Changing the name of the sheet in excel during a loop for
Each workbook just has one sheet that is to be named with the trailing sequence of the filename? That should be pretty simple, ...

23 days ago | 0

| accepted

Matlab strcmp Error - help
The biggest problem is you're trying to deal with numeric data as string -- convert to numeric. This, unfortunately, isn't hand...

26 days ago | 1

| accepted

How do I calculate the mean of only positive values
mean(X(X>0)) % global mean or arrayfun(@(i) mean(X(X(:,i)>0,i)),1:size(X,2)) % column means depending upon which mean...

27 days ago | 0

i want to use goto to jump from third line to eighth line.
if (i==4)|((dx/yg(i))<tand(sia)) X else P(i-1)=0 end or if (i~=4)&((dx/yg(i))>=tand(sia)) P(i-1)=0 else X end

28 days ago | 0

Linear model fit error
x1 = [7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 6.5 8.5 7.5 7.5 7.5 7.5 7.5 7.5 7.5 7.5 7.5].'; x2 = [12 12 12 12 12 12 12 12 20 20 20 20...

1 month ago | 0

I am getting error "Conversion to cell from uint8 is not possible." Can anyone please help in debugging this? Thank you for your time.
segmented_images=cell(1,3); did indeed define to be a cell array, but then you wrote segmented_images(k)=colors; segmented_im...

1 month ago | 1

| accepted

When using listdlg to create a menu, how do you access the user input?
>> cList = {'United Kingdom','Bulgaria','Germany','Greece','Sweden','Netherlands','Spain','Romania','Luxembourg','Poland'}; [in...

1 month ago | 0

| accepted

Edit a column in a dat file with some header lines and a table
A) goes something like nHeaders=11; % or whatever fidi=fopen(filenameIn,'r'); fido=fopen(filenameOut,'w'); for i=1:nHeaders...

1 month ago | 1

How to transfer data from a messy .rpt file to an array

1 month ago | 1

Error when fitting polyfit curve
Error is exactly what it says--you wrote: X = categorical({'March','April','May','June','July','August','November'}); M = reor...

1 month ago | 0

| accepted

Export a Char String to Excel
The example doesn't work as is, exactly... >> res = ['Carreau-Parameter: ';'a = 7521.1446 Pa*s ';'b = 0.10637 s ';'c = 0.7...

1 month ago | 1

| accepted

How to convert a vector to a string (Matlab2016a)
For what definition of "string"? >> A=1:3; >> num2str(A) ans = '1 2 3' >> num2str(A.') ans = 3×1 char array ...

1 month ago | 0

Continue Long Statements on Multiple Lines
ix=find(~contains(txt,'Sys')); >> arrayfun(@(ix) join(txt(ix-1:ix),1),ix) ans = 2×1 cell array {'Sys_7899 1=0.21 2=...

1 month ago | 0

Mean of mutiple variables
d=dir('data*.mat'); % or similar list. Name files so can use appropriate wildcard expression total=0; for i=1:numel(d) ...

1 month ago | 1

How to use fillmissing function within a group ?
>> varfun(@(x) fillmissing(x,'previous'),T,'groupingvariables',{'ID'},'InputVariables',{'amount1','amount2'}) ans = 6×4 tabl...

1 month ago | 0

| accepted