Answered

Dimensions of arrays being concatenated are not consistent error.

result_file.ActualSpeaker = T.Label{1}; ... result = [result; struct2table(result_file)]; You're trying to catenate char() ar...

Dimensions of arrays being concatenated are not consistent error.

result_file.ActualSpeaker = T.Label{1}; ... result = [result; struct2table(result_file)]; You're trying to catenate char() ar...

4 hours ago | 1

Answered

how to average multiple monthly data?

Convert to table or timetable and use retime and/or findgroups/splitapply for these kinds of operations.

how to average multiple monthly data?

Convert to table or timetable and use retime and/or findgroups/splitapply for these kinds of operations.

4 days ago | 0

| accepted

Answered

Char function for a cell array

The cell array would be >> Name = {'MATE'; 'GEAR'; 'FIVE'; 'SLOW'} % define column cellstr array Name = 4×1 cell array ...

Char function for a cell array

The cell array would be >> Name = {'MATE'; 'GEAR'; 'FIVE'; 'SLOW'} % define column cellstr array Name = 4×1 cell array ...

4 days ago | 0

Answered

How to seperate similar data stacked up in one coulmn into multiple columns

This is going to be somewhat of a pain in the proverbial appendage...it's not even clear what constitutes an iteration for certa...

How to seperate similar data stacked up in one coulmn into multiple columns

This is going to be somewhat of a pain in the proverbial appendage...it's not even clear what constitutes an iteration for certa...

4 days ago | 0

| accepted

Answered

Find average for each year

That should work fine excepting you didn't allocate for the different means by year and overwrote the variable meanT on each ite...

Find average for each year

That should work fine excepting you didn't allocate for the different means by year and overwrote the variable meanT on each ite...

6 days ago | 0

| accepted

Answered

How to calculate the mean for the number of occurances

u=unique([C{:}]); n=cell2mat(cellfun(@(x) histc(x,u),C,'uni',0)); n(n==0)=nan; x=cell2mat(arrayfun(@(x,n) repmat(x,1,n),u,rou...

How to calculate the mean for the number of occurances

u=unique([C{:}]); n=cell2mat(cellfun(@(x) histc(x,u),C,'uni',0)); n(n==0)=nan; x=cell2mat(arrayfun(@(x,n) repmat(x,1,n),u,rou...

8 days ago | 0

| accepted

Answered

How can I set the FormatSpec to read this numerical value?

ML doesn't have the facility built into any of the text conversion routines to handle the omitted exponent indicator; some Fortr...

How can I set the FormatSpec to read this numerical value?

ML doesn't have the facility built into any of the text conversion routines to handle the omitted exponent indicator; some Fortr...

8 days ago | 0

| accepted

Answered

Converting C++ to Matlab code!

disp("\nReading values from 'xxxx3padata.txt' file.....") val=importdata('xxxx3padata.txt'); Rmn=mean(abs(val)); Rms=rms(va...

Converting C++ to Matlab code!

disp("\nReading values from 'xxxx3padata.txt' file.....") val=importdata('xxxx3padata.txt'); Rmn=mean(abs(val)); Rms=rms(va...

11 days ago | 0

| accepted

Answered

I am unable to understand what happening in this code of Variance of 3*3 neighborhood

Just the point(s) r away from each point in the input image array in each plane. If the image were 256x256, and r were 5, say, ...

I am unable to understand what happening in this code of Variance of 3*3 neighborhood

Just the point(s) r away from each point in the input image array in each plane. If the image were 256x256, and r were 5, say, ...

12 days ago | 0

Answered

Hi All, I have several days worth of time stamped data. Unfortunatly the date has not been provided. How can I convert the time to datetime and increase the date by one day when the time passes 00:00:00? Thankyou

tsd=readtable('tsd.txt'); tsd.Var1=datetime(tsd.Var1); du=[duration(0,0,0);diff(tsd.Var1)]; ix=find(du<0); tsd.Var1(ix:end)=...

Hi All, I have several days worth of time stamped data. Unfortunatly the date has not been provided. How can I convert the time to datetime and increase the date by one day when the time passes 00:00:00? Thankyou

tsd=readtable('tsd.txt'); tsd.Var1=datetime(tsd.Var1); du=[duration(0,0,0);diff(tsd.Var1)]; ix=find(du<0); tsd.Var1(ix:end)=...

12 days ago | 0

| accepted

Answered

Printing just one column in text file in scientific notation

>> ab=[110.51 1.2222e-13 111.50 1.3897e-13 112.49 1.2342e-14 113.48 8.8123e-15]; >> fmt=['%8.2f %12.5e \n']; >> fprintf(fmt...

Printing just one column in text file in scientific notation

>> ab=[110.51 1.2222e-13 111.50 1.3897e-13 112.49 1.2342e-14 113.48 8.8123e-15]; >> fmt=['%8.2f %12.5e \n']; >> fprintf(fmt...

13 days ago | 1

| accepted

Answered

Discard unwanted information from string array

Alternatively, there's the new(ish) extractAfter function that was introduced with the new strings class... >> extractAfter(s,"...

Discard unwanted information from string array

Alternatively, there's the new(ish) extractAfter function that was introduced with the new strings class... >> extractAfter(s,"...

13 days ago | 2

Answered

How to find the index of a specific column in a matrix?

>> [~,ib]=ismember(x.',F.','rows') ib = 4 2 1 3 >>

How to find the index of a specific column in a matrix?

>> [~,ib]=ismember(x.',F.','rows') ib = 4 2 1 3 >>

13 days ago | 1

| accepted

Answered

How to sum 2 .mat file (Complex int)

The assignment of LOAD to a LHS variable creates a struct of the variable name provided with the fields the variable names in th...

How to sum 2 .mat file (Complex int)

The assignment of LOAD to a LHS variable creates a struct of the variable name provided with the fields the variable names in th...

13 days ago | 0

Answered

Line Breaking of char-array

>> fmt=['%04d' repmat('%6.2f',1,size(results,2)) '\n']; >> fprintf(fmt,[[1:size(results,1)].' results].') 0001 0.00 0.00 0....

Line Breaking of char-array

>> fmt=['%04d' repmat('%6.2f',1,size(results,2)) '\n']; >> fprintf(fmt,[[1:size(results,1)].' results].') 0001 0.00 0.00 0....

14 days ago | 1

| accepted

Answered

Date and time formate translation

dt=datetime('25-Mar-2014 13:00:00'); fmt= 'uuuu-MMM-dd''T''HH:mm:ss.SSS''Z'; dt.Format=fmt; >> dt = datetime 2014-Mar...

Date and time formate translation

dt=datetime('25-Mar-2014 13:00:00'); fmt= 'uuuu-MMM-dd''T''HH:mm:ss.SSS''Z'; dt.Format=fmt; >> dt = datetime 2014-Mar...

14 days ago | 2

| accepted

Answered

Average and plot variable from multiple .mat files

The first loop over k below is superfluous...it just loads each file into the same array but does nothing with it; then you star...

Average and plot variable from multiple .mat files

The first loop over k below is superfluous...it just loads each file into the same array but does nothing with it; then you star...

15 days ago | 0

Answered

Add a number(specific column) to vector without deleteing it.

One of many possible ways... insertat=2; val=2.5; a=[a(1:insertat-1) val a(insertat:end)]; The key is to not store into the ...

Add a number(specific column) to vector without deleteing it.

One of many possible ways... insertat=2; val=2.5; a=[a(1:insertat-1) val a(insertat:end)]; The key is to not store into the ...

17 days ago | 1

Answered

Extract data from polar plot [example.fig]

Well, a variant of that works ok here with the example polar plot in the documentation. >> hF=openfig('polar.fig'); >> hAx=gca...

Extract data from polar plot [example.fig]

Well, a variant of that works ok here with the example polar plot in the documentation. >> hF=openfig('polar.fig'); >> hAx=gca...

17 days ago | 0

Answered

How to load a specific channel from EEG into MATLAB

Often unless data files are simply humongous, it's just simpler to read it all in and then selectively keep what you're interest...

How to load a specific channel from EEG into MATLAB

Often unless data files are simply humongous, it's just simpler to read it all in and then selectively keep what you're interest...

17 days ago | 0

| accepted

Answered

How to get data based on first and second column

mxx=max(A(:,1)); % max X coordinate in array ix=ismember(A(:,1),[92:0.025:mxx]); % locations in A of desir...

How to get data based on first and second column

mxx=max(A(:,1)); % max X coordinate in array ix=ismember(A(:,1),[92:0.025:mxx]); % locations in A of desir...

19 days ago | 0

| accepted

Answered

How to bundle dates of several years?

Use findgroups and splitapply-- g=findgroups(AllWindDataSan01to14,month(AllWindDataSan01to14.DATE),day(AllWindDataSan01to14.DAT...

How to bundle dates of several years?

Use findgroups and splitapply-- g=findgroups(AllWindDataSan01to14,month(AllWindDataSan01to14.DATE),day(AllWindDataSan01to14.DAT...

19 days ago | 0

Answered

Plot 2 signals with different time axis in the same graph

plot(t1,y1) % first plot hold on % add more plot(t2,y2) % second line on top... or, y...

Plot 2 signals with different time axis in the same graph

plot(t1,y1) % first plot hold on % add more plot(t2,y2) % second line on top... or, y...

20 days ago | 0

| accepted

Answered

How can I join two vectors (integer and decimal)?

C=A+B./10.^fix(log10(B)+1);

How can I join two vectors (integer and decimal)?

C=A+B./10.^fix(log10(B)+1);

21 days ago | 2

Answered

Convert spreadsheet that contains variable names and numbers into simple variables

OK, given the example data from the original question in an .xls file -- to build a struct with those variables as fields with t...

Convert spreadsheet that contains variable names and numbers into simple variables

OK, given the example data from the original question in an .xls file -- to build a struct with those variables as fields with t...

23 days ago | 2

| accepted

Answered

How do I import a file containing both numbers and strings

If you're going to read in text in random locations, unless you can determine or require the user to tell you where those locati...

How do I import a file containing both numbers and strings

If you're going to read in text in random locations, unless you can determine or require the user to tell you where those locati...

24 days ago | 0

Answered

How to split huge .csv files to multiple .csv files based on size?

fidR=fopen('originalfile.csv','r'); % open the big file to read NFiles=20; ...

How to split huge .csv files to multiple .csv files based on size?

fidR=fopen('originalfile.csv','r'); % open the big file to read NFiles=20; ...

24 days ago | 0

| accepted

Answered

MATLAB Answers Wish-list #4 (and bug reports)

Can we remove/kill that annoying popup about the new RTE that comes up every time try to edit a response to make a correction or...

MATLAB Answers Wish-list #4 (and bug reports)

Can we remove/kill that annoying popup about the new RTE that comes up every time try to edit a response to make a correction or...

25 days ago | 0

Answered

the error " Assignment has more non-singleton rhs dimensions than non-singleton subscripts" when happen?

Index(1,:)=randi(1,K,length(QPSK_Set))=1; appears a typo; above wouldn't run. But, the error as given is because the size of s...

the error " Assignment has more non-singleton rhs dimensions than non-singleton subscripts" when happen?

Index(1,:)=randi(1,K,length(QPSK_Set))=1; appears a typo; above wouldn't run. But, the error as given is because the size of s...

26 days ago | 0

Answered

Scale one scattered dataset to fit another scattered dataset

Sure, your "equation" to minimize in least-squares sense is D1(x,y)-k*D2(t,z) function sse=sseval(k,D1,D2) sse=sum((D1-k*D1)...

Scale one scattered dataset to fit another scattered dataset

Sure, your "equation" to minimize in least-squares sense is D1(x,y)-k*D2(t,z) function sse=sseval(k,D1,D2) sse=sum((D1-k*D1)...

27 days ago | 0

| accepted