Réponse apportée
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...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Converting C++ to Matlab code!
disp("\nReading values from 'xxxx3padata.txt' file.....") val=importdata('xxxx3padata.txt'); Rmn=mean(abs(val)); Rms=rms(va...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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, ...

plus de 7 ans il y a | 0

Réponse apportée
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)=...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Discard unwanted information from string array
Alternatively, there's the new(ish) extractAfter function that was introduced with the new strings class... >> extractAfter(s,"...

plus de 7 ans il y a | 2

Réponse apportée
How to find the index of a specific column in a matrix?
>> [~,ib]=ismember(x.',F.','rows') ib = 4 2 1 3 >>

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 0

Réponse apportée
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....

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 0

Réponse apportée
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 ...

plus de 7 ans il y a | 1

Réponse apportée
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...

plus de 7 ans il y a | 0

Réponse apportée
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...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to bundle dates of several years?
Use findgroups and splitapply-- g=findgroups(AllWindDataSan01to14,month(AllWindDataSan01to14.DATE),day(AllWindDataSan01to14.DAT...

plus de 7 ans il y a | 0

Réponse apportée
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...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How can I join two vectors (integer and decimal)?
C=A+B./10.^fix(log10(B)+1);

presque 8 ans il y a | 2

Réponse apportée
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...

presque 8 ans il y a | 2

| A accepté

Réponse apportée
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...

presque 8 ans il y a | 0

Réponse apportée
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; ...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
[DISCONTINUED] 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...

presque 8 ans il y a | 0

Réponse apportée
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...

presque 8 ans il y a | 0

Réponse apportée
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)...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
Is there a matlab function similar to base R "row" or "col"? It returns a matrix of integers indicating their row number in a matrix-like object.
For the specific case, not knowing the general definition, row=@(x) kron(diag(x),ones(1,size(x,1))); col=@(x) row(x).'; Apply...

presque 8 ans il y a | 1

Réponse apportée
Help with menu command
Don't use fixed list, use an array of possible choices and keep a corollary variable of those already taken so those aren't ever...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
how can an function containing structure data can be used in main code while main code also containing same/different structure.
Variables in a function are in their own scope internal to the function, only what is returned tot the caller is available to th...

presque 8 ans il y a | 0

Réponse apportée
Finding peak width at threshold
OK, finally(! :) ) had time to sit down for a few minutes...it's more convoluted than if had just started from scratch, but I t...

presque 8 ans il y a | 0

Réponse apportée
use of function in if statement
First and foremost, to place a function in a script or other function as local, it must be outside a logic construct...you then ...

presque 8 ans il y a | 0

Charger plus