Answered
Question about non-existing file
" If I use the function dir() it says there is another file named '_Pelvis_Walk.csv'." No, your screenshot clearly shows that t...

3 years ago | 1

| accepted

Answered
Assigning values from one array to string values of another array
Are you trying to do something like this? v = 1:9; id = compose("idea%d",v(:)); sv = [5.7065; 3.2885; 7.8947; 5.8056; 5.7619;...

3 years ago | 0

Answered
how to convert hours to 'yyyy-MM-dd hh:mm:ss' format?
dtm = datetime(2012,4,24,'Format','yyyy-MM-dd HH:mm:ss') + hours(0:72).'

3 years ago | 0

| accepted

Answered
How to extract the first column of a structure array and save it as a different array
fnm = {files.name} https://www.mathworks.com/help/matlab/matlab_prog/comma-separated-lists.html https://www.mathworks.com/matl...

3 years ago | 1

| accepted

Answered
long integers in matlab
"what would be the recommended approach if I don't have access to Symbolic Math TB?" You can download VPI by clicking on the bi...

3 years ago | 1

| accepted

Answered
Convert string to variable.
This is the cause of your problems right here: US_matrix = [1 0 0; 0 1 0] UK_matrix = [0 0 1; 1 0 0] Having meta-data in vari...

3 years ago | 0

| accepted

Answered
How to extract a specific field value from struct
https://www.mathworks.com/help/matlab/matlab_prog/create-a-structure-array.html load('struct.mat') cc val = cc.NumObjects

3 years ago | 0

| accepted

Answered
How to combine two cell arrays as variables with changing sizes in a for loop for a fullfile command?
for ii = 1:numel(A7) jj = ceil(ii/10); F1 = fullfile(H5{jj},A7{ii}) end

3 years ago | 0

| accepted

Answered
How can I store all outputs from a nested for loop?
This is easier using linear indexing: a = rand(2,3); b = rand(2,3); c = rand(2,3); z = nan(numel(a),3); % preallocate for k...

3 years ago | 0

| accepted

Answered
save two variables using num2str
"what is wrong with this?" Forcing meta-data (pseudo-indices) into variable names, thus making your code slow and complex. For...

3 years ago | 0

Answered
Table to Array conversion using a for loop
A much better approach stores the imported data in the structure returned by DIR: P = 'absolute or relative path to where the f...

3 years ago | 0

Answered
Multiplication between two matrices with different number of rows
C = permute(A,[1,3,2]) .* reshape(B,1,[])

3 years ago | 0

| accepted

Answered
Using regular expressions to recognize pattern based on multiple lines
str = fileread('dogbone_raise3D.txt') out = regexp(str,'(?<=;TYPE:SOLID-FILL\s+;WIDTH:\S+\s*\n\s*)[^;]+','match') out{:} Note...

3 years ago | 1

| accepted

Answered
Averaging elements for a cell within a cell array
Where C is your cell array: V = mean([C{:}],2) https://www.mathworks.com/help/matlab/matlab_prog/comma-separated-lists.html h...

3 years ago | 0

| accepted

Answered
find 'last' function not working
"Any ideas on why this happens?" Yes. "Could it be a bug or am I doing a logical error? " You are doing several logical error...

3 years ago | 1

| accepted

Answered
Help needed with regular expressions
Do not learn from this regular expression. % [G]\-{0,1}\d{1,}\.*\d* % ^^^ match literal 'G' once, square b...

3 years ago | 1

Answered
How to sum 3D matrix along 2 and 3 dimention
B = ones(20,10,10); V = sum(B,2:3)

3 years ago | 0

| accepted

Answered
Perform mldivide between 3x3 matrix M and every RGB pixel in a image in GPU
format compact S = 5; M = rand(3,3); I = rand(S,S,3); % reference: A = nan(S,S,3); for ii = 1:S for jj = 1:S ...

3 years ago | 0

| accepted

Answered
Error in concatination in binary values
V = [8,14,10,9,6,3,2,7,6,11,6,3,13,15,6,0]; N = bin2dec(reshape(dec2bin(V,4).',8,[]).')

3 years ago | 0

| accepted

Answered
How do I grab all the files with a certain name pattern from several folders?
All_files -> Folder1 -> no1 -> grab1 -> Folder2 -> no2 -> grab2 ...

3 years ago | 1

Answered
Epoch time conversion using datetime function
Your value is in milliseconds (not seconds, as is standard for Unix time), so either divide the value by 1000: opt = {'Format',...

3 years ago | 0

| accepted

Answered
How to read images sequentially from a folder?
You can download the file NATSORTFILES by clicking the big blue download button here: https://www.mathworks.com/matlabcentral/f...

3 years ago | 1

| accepted

Answered
Given a long (50-2000 each set in scientific notation ex. +1.394013E-10) string of multiple numbers, how can I convert it to an array quickly.
The very efficient approach is to use SSCANF: str = "+1.362134E-10,+1.381140E-10,+1.397078E-10,+1.401982E-10,+1.400756E-10,+1.4...

3 years ago | 0

| accepted

Answered
textscan to read date and time column and numeric data together
T = readtable('WHP-SEA-TP116-HS417-S1.csv', 'NumHeaderLines',66)

3 years ago | 0

| accepted

Answered
Create Structure from cell array with dot separation in string
You can use SETFIELD() with a comma-separated list: V = pi; T = 'em1500.eta_t.x'; C = split(T,'.'); S = struct(); S = setfi...

3 years ago | 0

| accepted

Answered
file list when "dir" to import data
"How can I make the "liste" to have the sequentially increasing number in the name?" If you cannot change the filenames to use ...

3 years ago | 0

| accepted

Answered
How do i get multiple values all at once from cell array?
"... for loop(cause they are slow)" A well-written loop will be fast enough, e.g. where C is your cell array and assuming that ...

3 years ago | 0

Answered
converting csv timestamp to datetime on import
type test.csv T = readtable('test.csv','Format','%{M/d/y}D%T%d','Delimiter',{',',' '}) D = T.Var1 + T.Var2 + milliseconds(T.Va...

3 years ago | 0

| accepted

Answered
how to do the addition of the cell matrix ?
The simple and efficient MATLAB approach is to use SUM(): val = cat(3,[0,67.5000,0,67.5000,0;0,67.5000,0,67.5000,0],[79.3333,0,...

3 years ago | 0

| accepted

Answered
Strange behaviour: struct with cell values
"Strange behaviour: struct with cell values" The STRUCT() documentation explains what happens with cell array inputs: "... if v...

3 years ago | 0

| accepted

Load more