回答済み
How to save Char from Structure into Array MATLAB
S = load('Dataset.mat'); D = S.Dataset T = string({D.ClassName})

約3年 前 | 1

回答済み
why fread showing too many output arguments?
"So, does that mean 5-values represents 5-different parameters?" Yes, if that is what your file contains and the FREAD command ...

約3年 前 | 0

| 採用済み

回答済み
get folder names in a directory
Do NOT use CD just to access data files: absolute/relative filenames are more efficient and more robust. Rather than getting th...

約3年 前 | 0

回答済み
error in loading data from a sheet in .xlsx format
" I do have the sheet but matlab is still give me error." No, as the error message correctly states, there is NO sheet in that ...

約3年 前 | 0

| 採用済み

回答済み
convert int32 dates to matlab date (datenum)
"Date datatype is int32" You did not tell us the most important information, which is the epoch and step size. Assuming that t...

約3年 前 | 0

回答済み
sorting data with specific
A = [5,4,3,2,1;6,7,8,9,0]; B = sortrows(A.').'

約3年 前 | 0

| 採用済み

回答済み
How to properly create for loop with if statement
The simple and efficient approach: L = -180:20:180 L = mod(L,360)

約3年 前 | 0

回答済み
use unstack to reshape table with dummy variable (edited: alternative crosstab method)
Using UNSTACK is quite a neat solution because it will automatically pad different-length data to the same number of columns, ad...

約3年 前 | 0

| 採用済み

回答済み
How can I pass a function name into another function?
The functions that you nested inside TESFUN are only visible within TESTFUN: https://www.mathworks.com/help/matlab/matlab_prog/...

約3年 前 | 0

| 採用済み

回答済み
How to merge new variables and append new rows at the same time (when synchronizing timetables)?
R1 = array2timetable(randi([36 40],5,2),'RowTimes',dateshift(datetime('today'),'dayofweek','Friday',-5:-1),'VariableNames',["x1"...

約3年 前 | 0

| 採用済み

回答済み
Undefined function 'extractfield' for input arguments of type 'struct' in MATLAB R2023a
"After upgrading from Version 2022b to 2023a today morning, it gives me an error in the exact same code which was running perfec...

約3年 前 | 0

| 採用済み

回答済み
Extracting datetime and adding reference time
fnm = 'GPS_P01.txt'; txt = fileread(fnm); one = regexp(txt,'(?<=REFERENCE\s*TIME\s*:\s*)[^\n]+','ignorecase','match','once'); ...

約3年 前 | 0

回答済み
finding a numeric pattern in an array
V = [11,5,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,11,2,31,5,1,2,11,2,31,5,1,2,11,2,31,5,1,2,11,2,31,5,1,2,11...

約3年 前 | 0

| 採用済み

回答済み
COMBINE MULTIPLE ASCII FILE WITH SIMILAR COLUMN FORMAT OF (X,Y,Z) INTO SINGLE SINGLE FILE OF SAME COLUMN (X,Y,Z)
[F,P] = uigetfile('*.asc','Select the asc-files', 'MultiSelect','on'); F = cellstr(F); C = cell(size(F)); for k = 1:numel(F) ...

約3年 前 | 0

| 採用済み

回答済み
Select values of a matrix given a matrix of indices?
"is there any fast way to do this?" Use SUB2IND: A = rand(10,10) x = [2,3;5,7]; y = [4,6;1,2]; idx = sub2ind(size(A),x,y); ...

約3年 前 | 1

| 採用済み

回答済み
How to combine two tables using sorted common variable?
You could use OUTERJOIN: https://www.mathworks.com/help/matlab/ref/table.outerjoin.html a = load('data_A.mat'); a = a.data_A ...

約3年 前 | 1

| 採用済み

回答済み
Matlab column extraction sematics
" Is there some guide to datatypes and operations on them in Matlab that would cover this?" Of course: https://www.mathworks.co...

約3年 前 | 0

| 採用済み

回答済み
how to transform a table with column names into an double array without column names
"But using 'table2arrray' directly, entries of 'X' are all transformed into '0'." I doubt that. What is much more likely is tha...

約3年 前 | 0

回答済み
Reading a single numerical value from regexp return
Get rid of the loop and process the entire file at once. Line-by-line just makes it more complex. You can get rid of one layer ...

約3年 前 | 1

| 採用済み

回答済み
Finding the indexes of multiple substrings within a larger string.
idx = regexp(c,'\d\d') % no overlaps idx = regexp(c,'\d(?=\d)') % with overlaps

約3年 前 | 1

| 採用済み

回答済み
I don't understand what this function is doing 'Invoke'
"but what these 0, 0, 0, 0, 1, 1, 0 is doing? also that 2 at the end?" Those are inputs to some COM object's method. The method...

約3年 前 | 0

回答済み
Why can't the index variable of a for loop be stored in a structure or other array?
"More broadly, is there some way to store index variables together?" status.loop1 = 1:10; for k = status.loop1 %do someth...

約3年 前 | 1

回答済み
Choosing specific column within cells
Why not just use the same loop? There does not seem to be any point in using a second loop. for k = 1:numel(C) F = fullfil...

約3年 前 | 0

| 採用済み

回答済み
Creating new matrices with input depending on csv filename
See: https://www.mathworks.com/help/matlab/ref/fullfile.html https://www.mathworks.com/help/matlab/import_export/process-a-sequ...

約3年 前 | 0

| 採用済み

回答済み
How to select specific rows of data from .mat file containing multiple column vectors
F = 'name of your mat file'; S = load(F); D = structfun(@(v)v(100:499),S, 'uni',0)

約3年 前 | 0

回答済み
count nan of different rows
S = load('TG_sshobscorr.mat'); D = S.sshobscorr; Try either of these: N = sum(~isnan(D),2) N = sum(isfinite(D),2)

約3年 前 | 0

| 採用済み

回答済み
How to fix error with while loop?
"I keep getting the error shown below. How can I fix this? " By doing exactly what the error message tells you: move the script...

約3年 前 | 0

回答済み
when I using readtable to read .csv file all variable data get mixed, what are the reason for this and provide proper solution for this
There is no need to change the file format when you can simply specify the delimiter when importing: T = readtable('daily_cloud...

約3年 前 | 0

| 採用済み

回答済み
Adding Matrices into main diagonal of Matrix
"As we can see, matrix is not a 10x10 matrix with the main diagonal filled with the intended values above." After calling BLKDI...

約3年 前 | 0

| 採用済み

さらに読み込む