Respondida
Sorting a mixed text-numeric matrix (cell array) by one of its (numeric) columns
t=readtable(fileName,'readvariablenames',1); t.sort=rand(height(t),1); [~,ix]=sort(t.sort); t=t(ix,:);

más de 7 años hace | 1

| aceptada

Respondida
How to find common calendar of three matrices?
ABC=[A;B;C]; d=datetime(ABC(:,1:3)); g=findgroups(d); D=splitapply(@(x) {vertcat(x)},ABC,g); D=cell2mat(D(cellfun(@(c)size(c...

más de 7 años hace | 0

| aceptada

Respondida
how to find a non affected rank in a vector column
Probably for such a case as written for j=1:4 try set(h_leg(j),fontsize,12); catch end end will solve the probl...

más de 7 años hace | 1

| aceptada

Respondida
How to stop on a variable getting a specific value?
dbstop in file at if expression is best you can do I think...you don't have to manually insert the breakpoint at every line but...

más de 7 años hace | 0

| aceptada

Respondida
Why does matlab allow array indexing by a string by converting them into ascii codes?
Why? Because it retains consistency across data types of char() being simply an array of byes. Indexing by alphabetical inde...

más de 7 años hace | 1

Respondida
uigetfile for multiple type problem
Gotta' have good eyes in reading the documentation...use uigetfile({'abc*.mat';'*.dat'}) instead--a column instead of row vect...

más de 7 años hace | 0

| aceptada

Respondida
How to concatenate k vectors together without knowing the value of k ?
"... I have to do all these operations in one line in the max function" Well, no, not really -- that's a restriction you've pla...

más de 7 años hace | 1

Respondida
How to add x-axis in the bottom or in the top of a figure?
Indeed, why after 30 years TMW hasn't built parallel universe for it is simply incomprehensible, I agree. It isn't all that ha...

más de 7 años hace | 2

| aceptada

Respondida
How can i determine last infection point of a vector?
For the type of figure as shown, simple difference will work... >> d=[0 diff(A)]; >> A(d>4) ans = 173 >> where the '4'...

más de 7 años hace | 1

| aceptada

Respondida
i need to delete a zero from a single row 10 column vector
As we've covered the other cases pretty thoroughly... For the specific input vector OP showed where it is almost certain it is ...

más de 7 años hace | 0

Respondida
fplot command what is the default resolution ?
clear x f=@(x) 3*exp(-x).*sin(x); fplot(f,[0 8],'b') will produce the same plot -- fplot doesn't use your x array at all; it ...

más de 7 años hace | 0

Respondida
How to fix the ticklabels - time series analysis?
Clearly, the ticklabels you wrote are (1:5000)/20. The first label is 0.05 --> 1/20, the second 0.10 --> 2/20, etc., etc., ......

más de 7 años hace | 1

| aceptada

Respondida
How can i plot raw eeg data
You have to load the library first...see the example code in the documenation for checking...use your wanted library name, path ...

más de 7 años hace | 0

Respondida
How to extract the data lines from a large text file which contains combined numeric lines and text lines
Basic outline is as follows... fid=fopen('OneLineData.dat'); data=[]; l=fgetl(fid); while ~feof(fid) if contains(l,'SOFM ...

más de 7 años hace | 0

| aceptada

Respondida
How to read mixed delimited data from a text file?
If the file is tab-delimited, the spaces won't matter... data=dlmread(fullfile('yourdirectory','yourfile.txt'),'\t'); % read t...

más de 7 años hace | 0

Respondida
How can I erase Sheet1 Sheet2 and Sheet3 in excel file using writetable function in matlab?
Modifying workbook properties isn't what writetable does--it just writes to a given sheet, creating one of that name if it doesn...

más de 7 años hace | 0

Respondida
am trying to find the first and second derivates of a set of data points I've imported
That's essentially trivial file that data=csvread('data_10.csv'); data(:,2)=[nan;diff(data(:,1))]; % first difference...

más de 7 años hace | 0

Respondida
Difference between readmatrix() and readtable()
It appears readmatrix is limited to returning one type of data in the output array as the 'OutputType' named parameter is limite...

más de 7 años hace | 2

| aceptada

Respondida
Function handle not rechecking if statement
tf_f = @(T,Y) isempty(p_f(T,Y)); if tf_f(T,Y) == 1 && bottom_f(Y) > p21top_f(T) elseif tf_f(T,Y) == 1 && top_f(Y) < p21top_f(...

más de 7 años hace | 0

Respondida
limits are too large
K>> format short K>> sum(X(:)>1E100)/numel(X) ans = 0.8499 K>> sum(X(:)>1E200)/numel(X) ans = 0.7848 K>> sum(X(:)...

más de 7 años hace | 0

Pregunta


regexrep for the neophyte
How to write expression to find and convert financial strings written with comma separator to be able to parse numerically? Exa...

más de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


Brain freeze re: grouping and recombination
Have two files of correlated data via a categorical variable -- in the first, the name field has been normalized such that can f...

más de 7 años hace | 0 respuestas | 0

0

respuestas

Respondida
while/for loop
"know i have to use a for or while loop..." Not with Matlab, no! Use Logical indexing (link) as illustrated...

más de 7 años hace | 0

Respondida
Reading a csv file
You started off well w/ the readtable route...but, once you've got the table, then use the variables there, don't create new one...

más de 7 años hace | 1

Respondida
computing second derivative from txt/csv file based on existing excel algorithm
Here's perfect example why Matlab excels over Excel... :) txyz=importdata('B0264_dollyo_air_P_T01 rtoe.txt',',',8); % read the...

más de 7 años hace | 0

| aceptada

Respondida
How can I save a word e.g. 'apple' in a text file, without matlab separating every letter with a comma?
You undoubtedly use csvwrite or similar to write a character array -- internally a char() array is just that--an array of number...

más de 7 años hace | 1

| aceptada

Respondida
how to add a matrix element in a fzero function
As you wrote it, the function is the literal text including the argument so nothing ever gets substituted for dynamically--one w...

más de 7 años hace | 0

| aceptada

Respondida
How to find intersection point of two curves, when the intersection point is not there in data sets?
Both intersection sections appear to be straight lines; fit them and use fzero to find the point bblue=polyfit(xblue,yblue,1); ...

más de 7 años hace | 0

| aceptada

Respondida
Polynomial 2nd degree
Higher order polynomials aren't going to help here...the following code generated the figure: for i=3:9 subplot(4,2,i-2); ...

más de 7 años hace | 0

| aceptada

Respondida
code for computing the formular
fnP=@(a,i) (sum(a(i)>a(1:i))+0.5*sum(a(i)==a(1:i)))/i; >> for i=2:numel(Si),fnP(Si,i),end ans = 0.75 ans = ...

más de 7 años hace | 1

| aceptada

Cargar más