Answered
convert arraycell in array string
"it's possibile to convert in string?" Probably. I am guessing that you want something like this: C = {1;[2,34];[56,7,89]} F ...

3 years ago | 0

| accepted

Answered
How to rearrange data to a given decreasing rank order
A = [4,20,60,40,5]; X = [1,2,3,5,4]; B = sort(A,'descend'); B = B(X)

3 years ago | 0

| accepted

Answered
Extracting only certain data from a matrix
Where M is your matrix: X = M(:,1)==3; B = M(X,:)

3 years ago | 0

Answered
Calculate the average of each matrix block
Here are some simple MATLAB approaches: A = repmat([1,2,3,4,1,2,3,4,1,2,3,4,7,6,5,4],16,1) M = mean(permute(reshape(A,4,4,4,4)...

3 years ago | 0

Answered
Calculating a mean matrix of a cell array
M = mean(cat(3,A{:}),3,'omitnan')

3 years ago | 0

| accepted

Answered
Finding files in directory with two different strings in filename
Use FULLFILE rather than concatenating text together. Here is a simple approach that solves the problem you pose in your questi...

3 years ago | 1

| accepted

Answered
How to rename identical variables under one common name?
T = readtable('myData.xlsx') T.Type = regexp(T.Type,'^[A-Z]{4}','match','once')

3 years ago | 1

| accepted

Answered
Populate a matrix using the elements of some columns of another matrix as index and other as values
" may have multiple values with the same indices. In my case, I need to add the values with the same index" That is exactly wha...

3 years ago | 0

| accepted

Answered
Adjusting the datetick issue.
Do not use deprecated DATENUM or serial date numbers or the like. Use DATETIME (and set the format if required): S = load('m_t...

3 years ago | 1

Answered
Why can not the 'save' command store a matrix of single precision into a txt file? Warning: Attempt to write an unsupported data type to an ASCII file. Variable 'AA2' not wri
" What's the reason..." Because venerable SAVE does not really offer much functionality when exporting to text file, due to it ...

3 years ago | 0

| accepted

Answered
Format display number into table
You can change the variable viewer format in the options: Preferences -> Variables -> Format -> Default Display Format. You ne...

3 years ago | 0

| accepted

Answered
Define strings in MATLAB
"I have lots of set and get commands which I need to generate them within a for loop do that I have not to type all of them." D...

3 years ago | 0

| accepted

Answered
Hi! Can you help me create a vector containing multiples of 10? like 10^-5 to 10^5?
"Can you help me create a vector containing multiples of 10? like from 10^-5 to 10^5?" Guessing that you really mean integer po...

3 years ago | 1

| accepted

Answered
Find the indices of minimum value in each block of a block diagonal matrix
Using BWLABEL as KSSV suggested: S = load('synced_stamped.mat'); M = S.synced_stamp M(isnan(M)) = 0; [X,N] = bwlabel(M,4) F...

3 years ago | 0

Answered
datetime comparison fails but datenum works
"datetime comparison fails but datenum works" Actually DATENUM fails but DATETIME works. The dates you uploaded have a higher ...

3 years ago | 1

| accepted

Answered
Skip folders in a for loop
"How do I skip the dates 26, 27 and 28?" I would just use DIR to get a list of content in the parent folder. For example here i...

3 years ago | 0

| accepted

Answered
Strange behavior from readtable
While READTABLE's automagic file format detection is great, the more a file deviates (missing data, lines filled with asterisks)...

3 years ago | 0

| accepted

Answered
How to divide a 400x800 matrix to 8x8 blocks?
M = rand(400,800); [R,C] = size(M); C = mat2cell(M,8*ones(1,R/8),8*ones(1,C/8))

3 years ago | 0

Answered
I have a matrix. I want to count number of only those zeros which are lying between 2 sets of consecutive nonzero values on each side. How to do? Desired result given below
A general solution requires that: the 3rd value should be empty. therefore e.g. a container array needs to be used. Consider ...

3 years ago | 0

Answered
Increase the number of elements inside a cell
No loop, no concatenation required: A = {'5';'11'}; B = {'7';'19'}; out = [A,B]; % cell 2x2 parameter = 4; out(:,end+1:para...

3 years ago | 0

| accepted

Answered
Splitting Table Based on One Column Value
Use the correct type of indexing. Curly braces returns the table content, not another table: https://www.mathworks.com/help/mat...

3 years ago | 1

| accepted

Answered
How to extract multiple excel tabs into MATLAB
Do not use deprecated XLSREAD. It is very odd that your filename does not have a file extension, I fixed that for you: F = 'C:...

3 years ago | 1

Answered
How to create new rows in a table based on nested cell arrays of different sizes
This is MATLAB, so do not use on concatenation within loops to achieve this task. Better: S1 = load('file.mat'); S2 = load('fi...

3 years ago | 0

| accepted

Answered
unpack cell array of letters to be plugged into individual-cell rows, in a vector
Why are you storing numeric data as text? That must make data processing very awkward: most likely better data design would be t...

3 years ago | 1

Answered
Comparing two tables and replacing categorical column, row wise.
Why are you using a loop for this? MATLAB works best when you work in terms of vectors, matrices, and arrays: T1 = array2table(...

3 years ago | 0

Answered
Need help on the array of matrix.
B = reshape(A,3,[]).'

3 years ago | 1

| accepted

Answered
How to add extension to files using MATLAB
According to a comment you made in another thread, the files have no file extension. The first thing is to check if that is real...

3 years ago | 0

| accepted

Answered
convert a column matrix with many rows into multiple column of equal rows
A = [1;3;2;4;5;8;7;6;12;10] B = reshape(A,[],2) B = [1,8;3,7;2,6;4,12;5,10]

3 years ago | 0

| accepted

Answered
Inquiry about ceil function.
"I understand what ceil function does, however I do not understand why is necessary to sum + 1E-12" In lieu of useful code comm...

3 years ago | 0

| accepted

Answered
create matrix (rx1) with the data obtained from the for loop
"Maybe it is because there are numbers in the name field (not in sequence)? I don't think so." Yes, it is exactly because of th...

3 years ago | 0

| accepted

Load more