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...

8 years 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,"...

8 years 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 >>

8 years 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...

8 years 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....

8 years 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...

8 years 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...

8 years 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 ...

8 years 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...

8 years 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...

8 years 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...

8 years ago | 0

| accepted

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

8 years 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...

8 years ago | 0

| accepted

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

8 years 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...

8 years 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...

8 years 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; ...

8 years ago | 0

| accepted

Answered
[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...

8 years 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...

8 years 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)...

8 years ago | 0

| accepted

Answered
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...

8 years ago | 1

Answered
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...

8 years ago | 0

| accepted

Answered
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...

8 years ago | 0

Answered
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...

8 years ago | 0

Answered
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 ...

8 years ago | 0

Answered
Fron Python to Matlab
See doc randn When looking for something you don't know function name but have a clue about what is, lookfor keyword is u...

8 years ago | 0

Answered
How to plot the same variable from multiple excel files?
A. If you don't have to actually calculate across the various datasets, just process them sequentially -- a loop counter could ...

8 years ago | 0

Answered
calculation of a mean
26668626 isn't evenly divisible by 10; what do you want to do with the leftover 6 elements? You also can't add a column of 1/10...

8 years ago | 1

Answered
why "M(i,j) = 'NN' is illegal? and how to correct it?
'MM' is a 2-element character array that you're trying to store into one array element--"you can't do that!" :) To store a char...

8 years ago | 0

Answered
Changing elements of column and row in a matrix
One way... >> flipud(A(:,2:3).') ans = 6 5 90 91 >> Given the Comment below of arbitrary arrangement being arb...

8 years ago | 0

Load more