Beantwortet
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,'...

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 2

| akzeptiert

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

mehr als 5 Jahre vor | 3

| akzeptiert

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

Beantwortet
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)

mehr als 5 Jahre vor | 2

| akzeptiert

Beantwortet
Matrixr edundant rows removal
newmatrix = oldmatrix(find(uniquetol(oldmatrix(:,1))),:)

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
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';...

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 1

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

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
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);

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
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))];...

mehr als 5 Jahre vor | 2

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 1

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

mehr als 5 Jahre vor | 1

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

Beantwortet
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');

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 1

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

Beantwortet
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');...

mehr als 5 Jahre vor | 0

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 0

| akzeptiert

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

mehr als 5 Jahre vor | 1

| akzeptiert

Mehr laden