Beantwortet
How i creat Costomer fscanf?
format long M = readmatrix('sol2.txt', 'Delimiter',{' ','∠'}, 'MultipleDelimsAsOne',true, 'TrimNonNumeric',true)

15 Tage vor | 1

| akzeptiert

Beantwortet
How to save the Data in different array using Value in 2nd column
Clearly creating lots of separate variables in the workspace would be a very bad approach: https://www.mathworks.com/matlabcent...

15 Tage vor | 0

Beantwortet
Not enough input arguments (line 2)
You need to learn about function handles: https://www.mathworks.com/help/matlab/function-handles.html I also had to fix your c...

15 Tage vor | 1

| akzeptiert

Beantwortet
Return variable from nested function
Callback functions do not return output arguments**, so your approach will not work. The MATLAB documentation explains approache...

17 Tage vor | 0

| akzeptiert

Beantwortet
How to convert fields in a struct into an int?
This would be much easier if your data were better designed, exactly as I recommended in your last question (which you have so f...

18 Tage vor | 0

Beantwortet
How do you iterate over multiple fields in a structure?
One approach is to use FIELDNAMES() and dynamic fieldnames: https://www.mathworks.com/help/matlab/matlab_prog/generate-field-na...

18 Tage vor | 0

| akzeptiert

Beantwortet
Plotting data from struct array
"I am really not sure how to call plot with the plot vectors being contained in fields/subfields of a struct array." The answer...

19 Tage vor | 1

| akzeptiert

Beantwortet
Create folders and organize data based on file name.
movefile('*CP-A-01*.*', 'newdir01') movefile('*CP-B-01*.*', 'newdir02')

19 Tage vor | 0

Beantwortet
Is it possible to create a nested structure with dynamic field names?
"However, this version of dot indexing (right side dynamic naming) is not supported." Lets try it right now: S.A.B.C = pi; S....

19 Tage vor | 1

| akzeptiert

Beantwortet
How do I print a legend using a character array and integer array?
COMPOSE() is perfect for this, but was first introduced in R2016b. You could use ARRAYFUN() or CELLFUN(): C = {'Current','Curre...

20 Tage vor | 0

| akzeptiert

Beantwortet
Removing neighbours that are too close from eachother in a vector
x = [1,8,9,10,15,20,22,25,34] [~,~,y] = uniquetol(x, 5, 'DataScale',1); z = accumarray(y(:),x(:),[],@(v) v(ceil(end/2)))

20 Tage vor | 1

| akzeptiert

Beantwortet
Create a row vector comparing strings in a for loop
The simple MATLAB approach: s1 = { 'FMO1','FMO2','FMO3','FMO4', 'BAO1', 'BAO2', 'BAO3', 'BAO4'}; s2 = {'mean','FMO1','BAO4','F...

21 Tage vor | 1

Beantwortet
Convert string array to numetric.
data = ["01";"01";"10";"10";"01"] M = char(data)-'0'

21 Tage vor | 1

Beantwortet
How can i change struct size
S = load('sample_data.mat') E = S.ECOG E.locations E.locations(49:end) = [] % remove those structure elements E.locations

22 Tage vor | 0

| akzeptiert

Beantwortet
Importing data from csv file and my time data is being ruined changes from 24 hour time to 59 hour. How do I fix?
"I tried to export with format 'mm/dd/yyyy HH:mm:ss.SSS a', " Months are MM, minutes are mm: https://www.mathworks.com/help/ma...

22 Tage vor | 0

Beantwortet
Not able to store an Array field from a Structure to another variable
M = vertcat(F1.Position) or C = {F1.Position} https://www.mathworks.com/help/matlab/matlab_prog/comma-separated-lists.html h...

22 Tage vor | 0

Beantwortet
How to combine elements from cell?
a = {10,11;12,13} b = {20,21;22,23} c = cellfun(@horzcat,a,b, 'uni',0)

24 Tage vor | 0

| akzeptiert

Beantwortet
How do I assign a value to a field in a multi-level struct when the field name is contained in a variable?
You do not need any obfuscated fiddling around with SUBSASGN(). The standard MATLAB approach is to use SETFIELD() / GETFIELD():...

26 Tage vor | 0

Beantwortet
How to divide a column in table to other variables?
You need to specify the "GROUPINGVARIABLE" option, otherwise "...unstack treats the remaining variables as grouping variables. E...

27 Tage vor | 0

| akzeptiert

Beantwortet
Convert multiple strings in a table to numbers
T = cell2table({"cat","1.2","","3.4";"in","4.5","6","7";"hat","","89",""}) T = convertvars(T,2:4,'double')

27 Tage vor | 0

| akzeptiert

Beantwortet
I have 3 double array of sizes 6x1 double, 4x1 double and 5x1 double. I like to combine them to make a structure of size 1x3 struct containing all these 3 double arrays.
A = rand(6,1); B = rand(4,1); C = rand(5,1); S = struct('times',{A,B,C})

28 Tage vor | 0

| akzeptiert

Beantwortet
How to create a time vector that is incremented between two datetime strings?
"But my t outputs only a single time rather than an vector. How can I resolve this?" Of course you can use the COLON operator (...

28 Tage vor | 0

Beantwortet
Save numbers (present within a cell) into a single matrix
S = load('example.mat'); C = S.example C(cellfun(@isempty,C)) = {0}; M = cell2mat(C)

29 Tage vor | 0

| akzeptiert

Beantwortet
Multiply Constant Array by Another Cell Array
A = {(1:3).';(-1:2).'}; B = [2,3]; C = cellfun(@times,A,num2cell(B(:)), 'uni',0) C{:}

30 Tage vor | 1

| akzeptiert

Beantwortet
Combine different size matrix
Works for any data sets, you just need to specify the column/row order of the matrices: C = {[1,1,1;1,1,1;1,1,1];[2,2,2;2,2,2];...

etwa ein Monat vor | 2

| akzeptiert

Beantwortet
How to extract Datetime string to separate columns of yyyy dd mm hh mm
That is a very unfortunate date format. Best avoided. T = readtable('ararat.txt', 'Format','%{yyyyddMMHHmm}D%f'); % ugh. T.Pro...

etwa ein Monat vor | 2

| akzeptiert

Beantwortet
Initialising tabular data structure using struct()
A simple REPMAT does the job: M = zeros(nL,mL); data = repmat(struct('at',M, 'bt',M, 'pt',M), NL,ML);

etwa ein Monat vor | 0

Beantwortet
Table referencing using cell
The simple MATLAB approach is to use the JOIN() family: data = table({'a';'b';'c';'c';'a';'b';'b'}, [3;4;6;8;3;5;4],'VariableNa...

etwa ein Monat vor | 0

Beantwortet
How to add zeros in cell of string
The MATLAB approach: C = {'10';'00';'11';'011';'0101';'0100'} D = compose('%-08s',string(C))

etwa ein Monat vor | 0

Beantwortet
Subscript indices must either be real positive integers or logicals
You have created a variable in the workspace named MAX. You need to CLEAR that variable from the workspace, then try again.

etwa ein Monat vor | 1

| akzeptiert

Mehr laden