Answered
How can i name the column on a table ?
You created a table with one variable and one row, and that variable contains a large numeric matrix. This is not useful for you...

29 dagen ago | 0

| accepted

Answered
How to assign the values to a matrix?
https://www.mathworks.com/help/matlab/ref/sub2ind.html B = [1,9,12,31]; C = [1,4;3,6;5,2;6,3] A = zeros(6,6); % assign those...

29 dagen ago | 0

| accepted

Answered
Reading CSV as Structure Array
T = readtable('Test_Expression.csv', 'Decimal',',', 'Delimiter',';') S = struct('gene',{T.gene}, 'value',T.value) S.rawValue =...

29 dagen ago | 0

| accepted

Answered
element wise operation column matrix
T = [20;27;29;33;40]; A = T - T(1) B = [0;diff(T)]

ongeveer een maand ago | 0

Answered
Extract arrays from cell with order in a for loop
B = A; for k = 1:numel(A) array_to_crop = A{k}; array_cropped = array_to_crop(5:22,1); %Cropping selected array ...

ongeveer een maand ago | 0

| accepted

Answered
How to create corresponding equation in a column based on the value of previous column? (Similar to drag in Excel)
The MATLAB approach would be to use logical indexing: https://www.mathworks.com/help/matlab/math/array-indexing.html For examp...

ongeveer een maand ago | 0

| accepted

Answered
Read all .csv file in Folder , rearrange and write in one .csv file
P = 'absolute or relative path to where the files are saved'; N = 150; C1 = cell(1,N); C2 = cell(1,N); for k = 1:N F = ...

ongeveer een maand ago | 0

Answered
Trying to find row numbers from array inside cell array entry
T = readtable('Text1 1-10.txt', 'Delimiter','\t') https://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-table.html...

ongeveer een maand ago | 0

| accepted

Answered
Changing the variable names for multiple tables within a loop that imports the data
Using eval is a misdirection that forces you into writing slow, inefficient, complex code: https://www.mathworks.com/matlabcent...

ongeveer een maand ago | 0

Answered
Second derivative of a function handle
Tip for beginners: whenever you use EVAL you are doing something wrong. With symbolic variables you do not need to define anony...

ongeveer een maand ago | 0

| accepted

Answered
The logical indices contain a true value outside of the array bounds
As the error states, your logical indexing includes a TRUE value outside the size of that array. Compare: V = randi(9,1,3) X =...

ongeveer een maand ago | 1

Answered
How to create empty indexes when not available?
data = [2,3,4,5,3,2,4,5]; x = 5; n = 10; p = 2; window = data(max(1,x-n):min(end,x+p)) Are the NaNs really required?

ongeveer een maand ago | 0

| accepted

Answered
I need help preallocating an array of position vectors
Use a cell array: tmpout = cell(1,stack_size(4)) for frame_no = 1:stack_size(4) .. tmpout{frame_no} = pos; end mat...

ongeveer een maand ago | 1

| accepted

Answered
Naming new directories sequentially
N = number of directories P = 'absolute/relative path to the parent directory'; for k = 1:N D = sprintf('Prefix_%03d',k);...

ongeveer een maand ago | 0

| accepted

Answered
accessing multiple individual struct field values
S(1).data = [1;2;3]; S(2).data = [4;5;6]; S(3).data = [7;8;9]; n = 2; V = arrayfun(@(s)s.data(n),S) or (assuming that each ...

ongeveer een maand ago | 0

Answered
How to loop over different named structs?
cursor_info.Position = [0,1,2,3]; cursor_info1.Position = [1,1,2,3]; cursor_info2.Position = [2,1,2,3]; cursor_info10.Pos...

ongeveer een maand ago | 1

| accepted

Answered
Sort fields of struct by length and alphabetically
S.aa = rand(3,1); S.bb = 1; S.cc = rand(8,2); S.dd = 1; S.Ee = 1; S.Ff = rand(3,1) Method one: sort and indexing: N = str...

ongeveer een maand ago | 1

| accepted

Answered
Create Block Toeplitz Matrix
C = {zeros(3),randi(9,3),randi(9,3)}; % {0,B,A} N = 5; X = toeplitz([3,2,ones(1,N-2)]); M = cell2mat(C(X))

ongeveer een maand ago | 1

Answered
Load .dat files from subfolders with different names
This should get you started. Adapt to suit your data files, folder names, etc.: P = 'absolute/relative path to where the files ...

ongeveer een maand ago | 0

Answered
Mixed character Tab delimited csv file read in
fm1 = '#%s%[^\n\r]'; op1 = {'CollectOutput',true, 'Delimiter',':'}; fm2 = '"%f%f"'; op2 = {'CollectOutput',true}; hdr = {}; ...

ongeveer een maand ago | 1

| accepted

Answered
use variable name inside dlmwrite with respect to loop variable
https://www.mathworks.com/help/matlab/import_export/process-a-sequence-of-files.html for k = 1:4 M = ... your matrix ...

ongeveer een maand ago | 1

| accepted

Answered
How do you load m-files that contain filenames with integers and strings?
"...is there a way to use the %d notation in the file names to make this process more efficent?" Of course, the documentation s...

ongeveer een maand ago | 0

Answered
import file with exponential numbers
You are making this far more complex than it needs to be: M = readmatrix('1.txt')

ongeveer een maand ago | 1

| accepted

Answered
How to read data out of a .txt-File?
M = readmatrix('temp.txt','HeaderLines',18)

ongeveer een maand ago | 0

| accepted

Answered
Why matlab gives graph of exp(1/x) and exp(-1/x) wrong?
fun = @(x) exp(-1./x); fplot(fun) ylim([0,10]) fun = @(x) exp(1./x); fplot(fun) ylim([0,10]) I doubt there is much that ca...

ongeveer een maand ago | 0

| accepted

Submitted


Hyphenate
Word hyphenation using Franklin Mark Liang's algorithm (aka Knuth-Liang algorithm). Used in TeX.

ongeveer een maand ago | 4 downloads |

Thumbnail

Answered
Mean Value in a variables cell array
Where C is your cell array: N = size(C,1); M = nan(N,1); for k = 1:N M(k) = mean([C{k,:}]); end

ongeveer een maand ago | 0

| accepted

Answered
wilcard usage with strncmp
C = {'hello','* 2020','world','* 1923'}; X = ~cellfun(@isempty,regexp(C,'^\* \d{4}$')) D = C(X)

ongeveer een maand ago | 2

| accepted

Answered
Can't merge tables with error of weird array size limitation, help?
"I want to merge Table B into Table A (rows stay the same, only add the variables) and for identical variables want to keep the ...

ongeveer een maand ago | 0

| accepted

Answered
Checking whether string exist in a cell and read its ID
The simple, efficient MATLAB approach would be to use ISMEMBER: A = {'banana',12;'orange',23;'apple',35;'peach',74;'pear',51;'c...

ongeveer een maand ago | 2

| accepted

Load more