已回答
Sum in groups of ones and zeros
A possible solution: For ones: [sindx,endindx] = regexp(char(idx+'0')','1*') indx = arrayfun(@(x,y) x:y,sindx,endindx,'...

6 years 前 | 0

已回答
How can I specify the file path for csvwrite to write a file to?
csvwrite('C:\Users\T4H14\Documents\myfile.csv',mydata)

6 years 前 | 2

| 已接受

已回答
regexp split at first whitespace
You may use the *once* option to split only once at the first occurrence of whitespace. splitcells = regexp(data,'\s','split...

6 years 前 | 3

| 已接受

已回答
Adapting the datetime function
You must use the correctly specifiers for 'InputFormat', *mm* for minutes and *ss* for seconds. str = "13.07.2018 09:59:30....

6 years 前 | 1

| 已接受

已回答
Extract only numbers from a text file
str = 's.CircleByCenterPerimeter(center=(9.7593, 11.2643), point1=(9.8851, 11.2643))'; regexp(str,'(?<=\()-?\d+\.?\d+','match...

6 years 前 | 0

| 已接受

已回答
Sorting file (from a text file) and copying file to the new folder
If I am understanding the question correctly the following should help you: fid = fopen('SubjectsID.txt') while ~feof(fid)...

6 years 前 | 0

已回答
How to create this monotonically increasing list of numbers?
V = [1 1 2 1 2 3 1] n = 1:numel(V); L = repelem(n,V)

6 years 前 | 2

| 已接受

已回答
Matrixr edundant rows removal
newmatrix = oldmatrix(find(uniquetol(oldmatrix(:,1))),:)

6 years 前 | 0

| 已接受

已回答
How to filter data from multiple columns in a table
No loop is necessary. Yes, you need to use strcmp for the comparison. MT= {7 3 '15' 'response1'; 7 4 '25' 'response2';...

6 years 前 | 1

| 已接受

已回答
Find row in a matrix A corresponding to the row another matrix B
If I am understanding the question correctly the answer is simply: >>C = A(B==max(B),:) C = Columns 1 through 7 -...

6 years 前 | 0

| 已接受

已回答
Value associate to a parameter in a text
data = fileread('mytextfile.txt'); val = regexp(data,'(?<=\s)(-?\d*\.?\d*)(?=\s|$)','match');

6 years 前 | 0

| 已接受

已回答
Extracting X Y values from a .txt file
I think the best solution in this situation is to use regular expressions. Matlab's regexp supports named capture groups, which ...

6 years 前 | 1

已回答
How can I determine last row and pointed out in a xlsread?
You may use this <https://uk.mathworks.com/matlabcentral/fileexchange/28343-column-converter-for-excel?focused=5156839&tab=funct...

6 years 前 | 0

| 已接受

已回答
Importing 'n' number of cells in xlsread while n is not constant!
n = caselist(1,1); range = strcat('B4:B',num2str(n)) [num, txt] = xlsread('S:/PLOT/PLOT.xlsx', range);

6 years 前 | 0

| 已接受

已回答
How can I sum every nth row?
A = [1 2 3 4 5 6 7; 1 3 5 7 9 11 13; 2 4 6 8 10 12 14]'; [n,col] = size(A); index = 1:n; elem = [repmat(3,1,floor(n/3))];...

6 years 前 | 2

| 已接受

已回答
What would be the way to remove duplicates for defined numbers in array?
You can use strfind for matching patterns in arrays. Read more about it <https://blogs.mathworks.com/loren/2008/09/08/finding-pa...

6 years 前 | 0

| 已接受

已回答
How to generate all permutations of numbers if I have a number twice?
How about calling unique function after perms? data = unique(perms([1 2 2]),'rows'); data = 1 2 2 ...

6 years 前 | 1

已回答
How to check number of zeros in an array?
A = nnz(~A) B = nnz(~B) C = nnz(~C) D = nnz(~D)

6 years 前 | 1

| 已接受

已回答
Replace NaN in table with a corresponding value in a different column
You have not provided your table so I'll provide an example which should help you solve your problem. I have placed some NaNs i...

6 years 前 | 0

| 已接受

已回答
Read numeric data as string data from csv (table.txt) file?
You may use the %s specifier to read your data as strings. data = readtable('Table.txt','Format','%s%s');

6 years 前 | 0

| 已接受

已回答
string from a textbox
str = '4x^3 + 5x^2 + 6x^1 + 5' num = regexp(str,'(?<!\^)(\d)','match');

6 years 前 | 1

已回答
how to find the index of the highest negative element in a two dimensional matrix?
[row,col]=find(A==min(A(A<0)))

6 years 前 | 0

| 已接受

已回答
Extrapolate the times of entry and exit in timetable
%Find dbuid-17 in your second column. dbuid17indx = pir_tab_night.Column1streamId==categorical({'dbuid-17'}); %Use diff f...

6 years 前 | 0

| 已接受

已回答
how to compare string array with the names of structure's fields.
S.a = {'First field'}; S.b = {'Second field, entry 1','Second field,entry 2'}; S.c = {1,2,3}; mystring = {'a','game','m...

6 years 前 | 0

| 已接受

已回答
reading n columns and n rows from a file
Save your .txt file as file.dat. Then use: mydata = csvread('file.dat'); [row,col]=find(ismembertol(mydata,0.1350)); n =...

6 years 前 | 0

已回答
MATLAB codes to import or read multiples data and plot it on multiple images simultaneously
If I understand correctly, you want to process multiple text files which contain X,Y coordinates. Try: files = dir('*.txt');...

6 years 前 | 0

已回答
Separating values in cell arrays
[num, txt] = xlsread('mydata.xlsx', 'B4:B11'); mylist = cellfun(@(x) str2double(regexp(x,'(\d*\.?\d*)$','match')),txt);

6 years 前 | 0

| 已接受

已回答
How to show timestamps in a uitable in Matlab GUI?
f = figure; t = uitable(f,'Data',{datestr(now)},'Position',[50 200 900 70]);

6 years 前 | 0

| 已接受

已回答
count the change between a row and the next, in a column
For categorical array c chararr = cellstr(c); num = cellfun(@(x) regexp(x,'(\d)*$','match','once'), chararr,'un',0); nch...

6 years 前 | 1

| 已接受

加载更多