回答済み
Sort elements in cell array in descending order
fun = @(v) sort(v,'descend'); new_cell_array = cellfun(fun, cell_array, 'UniformOutput', false);

3年弱 前 | 0

| 採用済み

回答済み
Question on datestr to datetime conversion
datestr(timeseries(i),formatOut) Most likely TIMESERIES is a serial date number, the use of which is also discouraged and most ...

3年弱 前 | 0

| 採用済み

回答済み
Import data from a bad format
TEXTSCAN is very efficient, and imports numeric data as numeric (i.e. no fiddling around with text): fmt = repmat('%f',1,25); ...

3年弱 前 | 2

| 採用済み

回答済み
Reading uneven datasets from .mat file
Assuming that: the fields are in the required order (otherwise: you can sort them using ORDERFIELDS). the MAT file contains on...

3年弱 前 | 0

回答済み
Using logical array to extract data without reshape
Note that saving those huge lats&lons matrices is rather waste of space: you actually only need the first row/column. "Is there...

3年弱 前 | 0

| 採用済み

回答済み
readtable disfigures the CSV file header
data = readtable('headerFile.csv','ReadVariableNames', true, 'VariableNamingRule','preserve')

3年弱 前 | 2

| 採用済み

回答済み
Something wrong with "floor" or "fix" functions or it's my code?
"Something wrong with "floor" or "fix" functions" Nope, in fact those functions do absolutely nothing in your code. "or it's m...

3年弱 前 | 1

| 採用済み

回答済み
Read CSV into table but not all of the columns
First lets create a fake data file: writetable(array2table(rand(1e5,50),'Variablenames',"V"+(1:50)),"test.csv") Now lets try s...

3年弱 前 | 0

回答済み
Hello. This is my code and I keep getting the error "This statement is incomplete." several times throughout but can't find the mistake.
layers = [ ... sequenceInputLayer(numFeatures) lstmLayer(numHiddenUnits) fullyConnectedLayer(numResponses) regressio...

3年弱 前 | 0

回答済み
Using string() on double values without automatic rounding?
Rather than slow NUM2STR and then STRING, for a scalar the simpler and more efficient approach is to just call SPRINTF: sprintf...

3年弱 前 | 2

回答済み
What is the output after each recursive function call?
"I am confused what is meant by a function call in this case," A function call is every time a function is called. Usually func...

3年弱 前 | 1

| 採用済み

回答済み
Sum of all even index elements of a 1D array
"Why does it output 'No numbers in even positions' when the length of the array is greater than or equal to three and odd?" Bec...

3年弱 前 | 0

| 採用済み

回答済み
How do I separate a matrix that has a nested matrix in a cell before importing it to Classification Learner?
That does not seem like the best use of XLSX: storing lots of numeric data as long strings of text just makes processing the dat...

3年弱 前 | 0

回答済み
How to avoid linear indexing in operations involving matrices of different sizes
RESHAPE is very efficient, because no data gets moved in memory: A = rand(3,3); B = rand(3,2); idx = logical([0,1,1;0,1,1;0,1...

3年弱 前 | 0

| 採用済み

回答済み
Unique name detection in table headers
The old-fashioned way: D = {}; % data H = {}; % header fid = fopen('test_data_for_forum.txt','rt'); while ~feof(fid) H{...

3年弱 前 | 0

回答済み
Matlab 'borders' function not working. How to plot world map?
BORDERS is not inbuilt, it is a third-party function. You can download it here: https://www.mathworks.com/matlabcentral/fileexc...

3年弱 前 | 0

| 採用済み

回答済み
How to filter a cell array from entries from another cell array
cell1 = {'aaa';'bbb';'ccc';'ddd'}; cell2 = {'bbb';'eee';'fff';'aaa';'ccc'}; cell3 = setdiff(cell2,cell1) https://www.mathwork...

3年弱 前 | 0

| 採用済み

回答済み
How to find month wise mean and std from data of many years
"I think groupsummary is good function but I am unable to do that with my table data." Lets try it: T = readtable('data.csv')...

3年弱 前 | 0

| 採用済み

回答済み
From a structure with "n" fields which each are a vector, I want to make a vector of length "n" made of the 3rd value of each vector of my structure.
You could use ARRAYFUN to iterate over the elements of a structure (but this will be slower than a well-written loop): file = s...

3年弱 前 | 0

| 採用済み

回答済み
in R2023a, A text file, containing huge data in one column,How arrange data in 6 colum.where The first six number at the first Row and second six number in second Row.
F = 'the name fo your file'; M = readmatrix(F); M = reshape(M,6,[]).'

3年弱 前 | 0

| 採用済み

回答済み
table2struct(struct2table(s)) does not return s when some fields are cell arrays with a single element
"Is there a way to guarantee that table2struct(struct2table(my_struct)) returns an identical struct array?" No. "Alternatively...

3年弱 前 | 1

| 採用済み

回答済み
is there a command similar to map() that you can use in Matlab
"In Matlab is there anything similar to this command, can anyone tell me?" MAP is just a very basic kind of interpolation. MATL...

3年弱 前 | 0

回答済み
How can I save the data from my function as a new .mat file?
Change newFilename = fullfile(filepath, name , '_RT.mat'); to newFilename = fullfile(filepath, [name,'_RT.mat']); % ...

3年弱 前 | 0

| 採用済み

回答済み
fill a matrix within a loop
"tr_x_ch = 2752 is the actual reply" Then tr_x_ch is a scalar. The length of a scalar is exactly 1 (by definition), so your loo...

3年弱 前 | 0

| 採用済み

回答済み
How to interpolate from a dataset using interp3?
"How to interpolate from a dataset using interp3?" It is very simple: don't use INTERP3. "It's completely unlogical" It is pe...

3年弱 前 | 0

| 採用済み

回答済み
Unable to use value of type string as an index
"I wanted to get the details corresponding to each chain in separate matrices since all the details are clubbed into one single ...

3年弱 前 | 0

回答済み
How to rearrange 2x5 matrix while keeping the size the same?
Rather than sorting the data, I suspect that you want something like this: x = [1, 5, 9, 4, 8; 3, 7, 2, 6, 10] y = reshape(x,[...

3年弱 前 | 1

| 採用済み

回答済み
Convert a string array to numbers (RGB triplets)
S = ["0 0 0.17241"; "0 0 1"; "0 0 1"; "0 0 1"; "0 ...

3年弱 前 | 0

| 採用済み

回答済み
categorical conversion to integer
M = categorical([0,1;1,0]) X = double(M); Y = int8(str2double(categories(M))); Z = Y(X)

3年弱 前 | 1

回答済み
Best way to get date and time inputs from user and save as a datetime variable
No conversion back-and-forth is required: your approach of adding a DATETIME and DURATION object is the correct one. Sadly the D...

3年弱 前 | 0

| 採用済み

さらに読み込む