回答済み
Get special variable out of every struct in workspace
"Is there any way to extract the "values" out of these 2 structs for each variable which is loaded into the workspace?" Yes, bu...

3年以上 前 | 1

回答済み
How to load all .mat file in the current directory and save them as .wav file?
P = 'C:\Users\Desktop\BE'; S = dir(fullfile(P,'*.mat')); for k = 1:numel(S) F = fullfile(S(k).folder,S(k).name); D =...

3年以上 前 | 1

| 採用済み

回答済み
How do I add rows to a table in a for loop?
"... it keeps producing the tables I want, but not in the order I want, and I don't know how to fix this." My guess (in lieu of...

3年以上 前 | 0

回答済み
identifying entry elements in rows of logical matrix
A = [1,1,1;0,1,1;0,0,0;0,1,0] B = A .* (cumsum(A,2)==1) % replace .* with & to get a logical output

3年以上 前 | 3

| 採用済み

回答済み
How to perform function whos output is a struct in a loop?
Assuming identical fieldnames, the simplest and most robust solution is to concatenate the structure after the loop: N = numel(...

3年以上 前 | 0

回答済み
Deleting fields of a particular dimension in a structure
As I wrote in several of your earlier questions, this task would be much easier if your data were better designed: https://www....

3年以上 前 | 0

回答済み
How can I change timestamp format?
The best solution is to fix the source. Otherwise: C = {'09.02.2022 14:41:56:999';'09.02.2022 14:41:57:1'} D = regexprep(C,{':...

3年以上 前 | 0

| 採用済み

回答済み
Creating a row vector of combinations?
One simple aprpoach is to download this FEX submission: https://www.mathworks.com/matlabcentral/fileexchange/24325-combinator-c...

3年以上 前 | 3

回答済み
Extracting names from first row of index and seeing if they are equal to indexed variable?
You can simplify this by using one loop. Lets first create some fake data: mkdir ./scan1 mkdir ./scan2 mkdir ./scan3 writema...

3年以上 前 | 0

| 採用済み

回答済み
How to eliminate values after comma, in double value?
A wild guess: V = [0.2,0.2862] W = fix(V*10)/10

3年以上 前 | 1

| 採用済み

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

3年以上 前 | 1

| 採用済み

回答済み
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...

3年以上 前 | 0

回答済み
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...

3年以上 前 | 1

| 採用済み

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

3年以上 前 | 0

| 採用済み

回答済み
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...

3年以上 前 | 0

回答済み
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...

3年以上 前 | 0

| 採用済み

回答済み
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...

3年以上 前 | 1

| 採用済み

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

3年以上 前 | 0

回答済み
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....

3年以上 前 | 1

| 採用済み

回答済み
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...

3年以上 前 | 0

| 採用済み

回答済み
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)))

3年以上 前 | 1

| 採用済み

回答済み
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...

3年以上 前 | 1

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

3年以上 前 | 1

回答済み
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

3年以上 前 | 0

| 採用済み

回答済み
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...

3年以上 前 | 0

| 採用済み

回答済み
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...

3年以上 前 | 0

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

3年以上 前 | 0

| 採用済み

回答済み
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():...

3年以上 前 | 0

回答済み
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...

3年以上 前 | 0

| 採用済み

回答済み
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')

3年以上 前 | 0

| 採用済み

さらに読み込む