Answered
Write values of large cell to .inp file
Do not use nested loops! Your approach mixes up nested loops and a format string that prints each line. Better: fmt = repmat(',...

3 years ago | 0

| accepted

Answered
how to create for loop in below formula
Your inefficient approach (with anti-pattern numbered variable names): LP1 = rand; LP2 = rand; LP3 = rand; LP4 = rand; LP5 ...

3 years ago | 0

Answered
Expanding current code to be used on folder of these file types, and changing strings into numbers per file.
Download SIP2NUM from here: https://www.mathworks.com/matlabcentral/fileexchange/53886-scientific-prefix-to-number (this code ...

3 years ago | 0

| accepted

Answered
How to plot weeknumbers (integers) in a graph without leaving gaps for weeks that do not exist
This turns out to be surprisingly difficult without DATETIME et al supporting ISO 8601 weeknumbers. The rules for ISO 8601 week...

3 years ago | 0

Answered
vertcat errors - need a 'workaround' solution
S = load('datatables.mat') T1 = S.C1; T2 = S.R1; C1 = categories(T1.ImpactWind) C2 = categories(T2.ImpactWind) C0 = unique(...

3 years ago | 0

| accepted

Answered
export structs within structs
So many nested scalar container arrays: this is very inefficient data design. Much better would be e.g. one non-scalar structure...

3 years ago | 1

| accepted

Answered
im struggling with this one guys like the oddsum and the rest is undefeatable with me
N = 'S2307605'; % must be character V = N(2:end)-'0' R = rem(sum(3*V(1:2:end))+sum(V(2:2:end)),11) S = struct('S','A':'K','G'...

3 years ago | 0

Answered
split struct based on description
C = {S.SeriesDescription}; S_scout = S(strcmpi(C,'Scout')) S_serie = S(strcmpi(C,'Serie')) S_stand = S(strcmpi(C,'Standard'))...

3 years ago | 0

| accepted

Answered
select, only once, the names present in a struct
C = unique({S.SeriesDescription}) https://www.mathworks.com/help/matlab/matlab_prog/comma-separated-lists.html https://www.mat...

3 years ago | 0

| accepted

Answered
Load data as structure in Matlab App Designer
Here is a simple way to convert the output from UIGETFILE to a non-scalar structure similar to that returned by DIR: [F,P] = ui...

3 years ago | 0

Answered
create a struct with two columns
"How can I do it?" S = struct([]); for k = 1:7 name_char % = '0001'; folder_char %= 'C\.....'; S(k).name = nam...

3 years ago | 0

| accepted

Answered
Read files in a folder with dates on them
The actual solution is to parse the filenames that you gave. Lets create some fake files with fake data: X=1;save Profile_1990_...

3 years ago | 1

| accepted

Answered
How to select multiple contain conditions in a table?
The MATLAB approach: T = readtable('LOOP Events.xlsx','Range','D:K'); T = rmmissing(T) % remove empty rows X = matches(T.Oper...

3 years ago | 0

| accepted

Answered
matfile function for multidimentional arrays
Why not simply PERMUTE the dimensions to A to suit? JJ = nan(2,11,21,111,111,3); save test.mat JJ -v7.3 clearvars MF = matfi...

3 years ago | 0

| accepted

Answered
want to change what data I am plotting by text name.
Do NOT load directly into the workspace, always LOAD into an output variable (which is a scalar structure). Then simply use thi...

3 years ago | 0

| accepted

Answered
Read number from a string from multiple files
"is there a way to modify my code such that it counts how many eta files there are in the output folder without having to manual...

3 years ago | 0

| accepted

Answered
How to change datetime format?
You can specify different formats for the input and display: DT = datetime('02-Jul-2023','InputFormat','dd-MMM-yyyy', 'Format',...

3 years ago | 2

| accepted

Answered
Extract column from text file
Fake data (you would use FILEREAD): S = sprintf('%s\n','P1,R0,14:17:36.779,47,0.01421266,[-0.03077913; 0.3226232; -0.4286367],[...

3 years ago | 0

Answered
saving files in a folder
save([vFolder,'\' 'Pzz'+f+'X'+zz.mat'],'cn','y','z'); % ^^^^^^^ invalid syntax Better: fnm = sp...

3 years ago | 0

| accepted

Answered
How to convert cell (with 6x1 tables) into a multirow table?
If all of the tables in the cell array have compatible sizes and column/variable names, then all you need is: T = vertcat(my_ce...

3 years ago | 0

| accepted

Answered
How to access column of double in struct array?
"...and turn them into matrix data" "Can you help me?" Download this: https://www.mathworks.com/matlabcentral/fileexchange/22...

3 years ago | 0

| accepted

Answered
Dot notation and curly braces with TABLE
You can think of curly-brace indexing into a table as being something a bit like parenthesis indexing into a numeric array: V =...

3 years ago | 0

| accepted

Answered
How to store multiple outputs of a structure into a character array using logical indexing.
https://www.mathworks.com/help/matlab/matlab_prog/comma-separated-lists.html https://www.mathworks.com/matlabcentral/answers/16...

3 years ago | 1

| accepted

Answered
Dynamically specifying table columns in a loop - with a row number...
"Any tips?" Read the MATLAB documentation: https://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-table.html From...

3 years ago | 0

| accepted

Answered
array in array struct
"i want element (1:10) of each fields.." Your structure only has one field, named "F". You can iterate over the 73 elements ...

3 years ago | 1

Answered
How to convert time in microseconds (queryperformancecounter(qpc)),import from an excel file, to time (hh:mm:ss)?
T = readtable('Project_prova Data Export.xlsx') tx = strcat(T.RecordingDate,'T',T.RecordingStartTime); DT = datetime(tx, "Inpu...

3 years ago | 1

| accepted

Answered
Extract data from struct array
"Since data(1:10).sys.sys1.sub1.dataPoint1 does not work.." First lets generate your sample structure: dt = 1/1000; T = 5; t...

3 years ago | 0

Answered
How to separate four columns on the basis of 5th column
format short G S = load('Dataset.mat'); D = S.Dataset Method one: ARRAYFUN: V = D(:,5); U = unique(V) C = arrayfun(@(x)D(x...

3 years ago | 0

Answered
Struggling with multiple csv files
"I don't have an idea how to correct these errors. Does anyone have an idea?" The error message already tells you how: "Check t...

3 years ago | 0

| accepted

Answered
How to create multidimensional array with specified row values
m = 6; n = 7; A = cumsum(ones(m,n),1) A = repmat(1:m,n,1).' A = (1:m).' * ones(1,n) A = min(1:n,(1:m).') A = repmat((1:m)....

3 years ago | 1

| accepted

Load more