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

plus de 6 ans il y a | 0

Réponse apportée
How can I specify the file path for csvwrite to write a file to?
csvwrite('C:\Users\T4H14\Documents\myfile.csv',mydata)

plus de 6 ans il y a | 2

| A accepté

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

plus de 6 ans il y a | 3

| A accepté

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

plus de 6 ans il y a | 1

| A accepté

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

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 0

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

plus de 6 ans il y a | 2

| A accepté

Réponse apportée
Matrixr edundant rows removal
newmatrix = oldmatrix(find(uniquetol(oldmatrix(:,1))),:)

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 1

| A accepté

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

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Value associate to a parameter in a text
data = fileread('mytextfile.txt'); val = regexp(data,'(?<=\s)(-?\d*\.?\d*)(?=\s|$)','match');

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 1

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

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 2

| A accepté

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

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 1

Réponse apportée
How to check number of zeros in an array?
A = nnz(~A) B = nnz(~B) C = nnz(~C) D = nnz(~D)

plus de 6 ans il y a | 1

| A accepté

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

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
string from a textbox
str = '4x^3 + 5x^2 + 6x^1 + 5' num = regexp(str,'(?<!\^)(\d)','match');

plus de 6 ans il y a | 1

Réponse apportée
how to find the index of the highest negative element in a two dimensional matrix?
[row,col]=find(A==min(A(A<0)))

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 0

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

plus de 6 ans il y a | 0

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

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How to show timestamps in a uitable in Matlab GUI?
f = figure; t = uitable(f,'Data',{datestr(now)},'Position',[50 200 900 70]);

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
can you help me to correct this program i write it to remove the rows who The sum of its elements is zero
For matrix a a(~sum(a,2),:) = []

plus de 6 ans il y a | 1

Charger plus