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

casi 6 años hace | 1

Respondida
How to transfer data from a messy .rpt file to an array
>> data=textread('output.rpt','%s','delimiter','\n','headerlines',5) data = 14×1 cell array {'CASE = ""' ...

casi 6 años hace | 1

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

casi 6 años hace | 0

| aceptada

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

casi 6 años hace | 1

| aceptada

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

casi 6 años hace | 0

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

casi 6 años hace | 0

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

casi 6 años hace | 1

| aceptada

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

casi 6 años hace | 0

| aceptada

Respondida
Index exceeds the number of array elements (Very odd case)
Well, yes, that can happen but it won't necessarily always, depending upon what the data are in the two arrays. ... [SOCu, ind...

casi 6 años hace | 1

Respondida
Plot 2 vectors (different size) on same histogram normalized such that both have total area 1
Use 'Normalization','pdf' instead.

casi 6 años hace | 1

| aceptada

Respondida
How to find X value of given Y close to zero ?
[~,ix]=min(abs(m),[],'all','linear'); [~,j]=ind2sub(size(m),ix); >> o(j) ans = 340 >>

casi 6 años hace | 0

| aceptada

Respondida
export txt with text and numers
Does seem as though TMW has ignored such in terms of prepared functions; probably because there is no limit to the possibliliti...

casi 6 años hace | 0

Respondida
How to add values in matrix if in a conditions is met?
>> accumarray(findgroups(data(:,1)),data(:,2)) ans = 3.5000 1.5000 4.8000 2.5000 5.4000 2.8000 ...

casi 6 años hace | 0

| aceptada

Respondida
How to create extra data based on a string cell value?
Read the data into a table instead is probably quite a lot easier. Then use grouping variables to operate over data by whatever...

casi 6 años hace | 0

Respondida
readMatrix/for loop issue
MATLAB is case sensitive--the function is readmatrix, not readMatrix

casi 6 años hace | 0

Respondida
How do I use use sprtintf for a loop?
Probably the most-asked question of all...don't build the names, use dir d=dir('Monday*.csv'); % better to use fully-qual...

casi 6 años hace | 0

Respondida
How can I exclude specific data points from a data file?
Just select the data want (or conversely, remove what don't want)... Fout=1000; ZLim=2.5E6; isOut=(rawData(:,1)==Fout) & (raw...

casi 6 años hace | 0

Respondida
Difference between two successive elements in a matrix
D=diff(A(:,2)); ix=find(D>5)+1;

casi 6 años hace | 1

Respondida
How to plot two lines with different scales in MATLAB?
So what, specifically did you try and what didn't work? Seems straightforward... t=readtable('t.csv'); plot(t.Date,t.IP) yla...

casi 6 años hace | 0

| aceptada

Respondida
How to find is between values for 1min datetime delta
>> tlower.Format='Default'; >> tupper.Format='Default'; >> [tlower tupper] ans = 1×2 datetime array 01-Jan-2020 15:18...

casi 6 años hace | 0

| aceptada

Respondida
histogram with three sets of data
So what have you tried? Did you read the doc for bar and look at examples? XData=categorical({'Category A','Category B','Categ...

casi 6 años hace | 0

| aceptada

Respondida
getting info from a unique ID in a csv
Power of the MATLAB table comes fore... tElev=readtable('elevatorexample.csv'); FindFloor=2; % the f...

casi 6 años hace | 0

| aceptada

Respondida
why wont text scan read all rows?
MPG Cylinders displacement horsepower weight acceleration model year origin car name 18 8 307 130 3504 12 70 1 chevrolet chevel...

casi 6 años hace | 0

Respondida
matlab Fit the third polynominal
I'm guessing something on the lines of the following would be about the ticket... nProp=listdlg('ListString',{'Ultimate strengt...

casi 6 años hace | 0

Respondida
How to extract data from one column using the data from the two other columns
res=B(ismember(A,C));

casi 6 años hace | 0

Respondida
Obtain seperate legend for each contour line
There's no way to make legend use the contour lines directly; there are not any object handles to them; and the legend is global...

casi 6 años hace | 0

| aceptada

Respondida
Import a CSV file with no header separating numbers from symbols in a table
Gotta' give it a little help...but boy! that's ugleee! :( At least they did use quoted strings. opt=detectImportOptions('Miche...

casi 6 años hace | 0

Respondida
How to add a newline after a certain number of characters
function strMultiLines=nCharLine(strtxt, n) fmt=[repmat('%c',1,n) '\n']; strMultiLines=sprintf(fmt,strtxt); end for inpu...

casi 6 años hace | 1

Respondida
How to average over different length vectors without excessive for loops?
Use a cellarray to store the results of each trial instead of individual named variables; then means=cellfun(@mean,x);

casi 6 años hace | 0

Respondida
how to find index of matrix
Try [row,col]=find (A(:,1)==9 && A(:,3)=5.125) You've got the column indices off -- If you really mean for it to be for A(:,2...

casi 6 años hace | 0

Cargar más