Community Profile

SM

Last seen: Today Active since 2019

Content Feed

View by

Question

How can I find indices?
I have two matrices: A=[1 2 3 3 1 1 2 1; 1 1 1 2 2 3 2 3]; B=[2 1; 1 3]; The output matrix will be either indx=[2, 6...

29 days ago | 2 answers | 0

2

Question

Version MATLAB 2020b: How can i convert an array to cell array with specific size?
I have an array which is as follows: MP1=[1 5 3 1 3 4 2 3 1 4 2 2 3 2 6 5 2 2 3 3 6 3 1 2 3 2 3 3 1 2 2 2 4 6 4 2 1 3 3 6 2 2 2...

2 months ago | 1 answer | 0

1

Question

How to convert a matrix to a string array:
I have a matrix: R=[1 2 1 3 2 3 1;1 1 2 1 2 2 3]; that i want to convert to: Q=["A11","A21","A12","A31","A22","A32","A13...

2 months ago | 2 answers | 0

2

Question

How to use "dir"?
I have 45 folders with name Inst1, Inst2, Inst3,Inst4,........Inst45. I use a command of finfo=dir('Inst*'); The outcome ...

9 months ago | 2 answers | 0

2

Question

How can open and read .dat file?
A=[3 4 4 NaN NaN NaN NaN NaN; 36 46 4 4 1 3 NaN NaN; 24 32 3 3 1 3 2 3; 25 32 3 3 1 3 ...

10 months ago | 1 answer | 0

1

Question

How can I delete the duplicate rows in cell based on a particular column?
The input is: A={[1 2 3] [2 3] [1 2 3];[2 5 8] [3 4] [1 2 3];[2 5 4] [2 3] [1 2 3];[1 2 5] [3 4] [1 2 3]}; based on the dupli...

10 months ago | 1 answer | 0

1

Question

how to delete value?
I have two arrays which are: A=[1 1 4 2 1 3 1 3 2 2]; a=[1 3 1 2]; The outcome will be: A=[4 1 1 3 2 2]; The...

10 months ago | 0 answers | 0

0

Question

How to reduce decimal point in .dat file?
I use the following code: format long g A=round(randperm(10,8)); save 'A.dat' A -ascii output in .dat file: 9.0000000e+00 ...

11 months ago | 1 answer | 0

1

Question

How to find out zeros and their indices in a matrix?
I have an input matrix of size 3*13 double: input=[0 0 1 0 0 0 1 1 1 0 0 0 0; 0 1 0 0 1 1 0 0 0 1 0 1 0; 0 1 1...

11 months ago | 2 answers | 0

2

Question

How to access data set from different folders?
I can easily access .dat files from the current directory by using the following codes: %% Input data set load ProcMacMatrix...

11 months ago | 2 answers | 0

2

Question

How to save multiple matrix in a .dat file
First, I have three matrices which I want to save in single .dat file. A=[1 2 3 4;5 6 7 8;9 10 11 12]; B=[13 14 15 16 20; 12 ...

11 months ago | 1 answer | 0

1

Question

How to convert from a matrix to a cell?
Given matrix is A=[1 2 3 4 5 6 7 8; 9 10 11 12 13 14 15 16]; and output is B={[1 2 3 4],[5 6 7 8];[9 10 11 12],[13 14 15 16]}...

11 months ago | 1 answer | 0

1

Question

How to convert a cell to matrix?
Example: A={[1 3 4]; [2 5 6 4]; [2 6 8 9 5 6]; [3 6 5 4 1]} I know it is not possible by using B=cell2mat(A); a...

11 months ago | 2 answers | 0

2

Question

how to create a random integernumbers with conditions?
I just want to create an array at random which size will be 1 by sum([4 3 3]). The array contains 1 at 4 times, 2 at 3 times and...

11 months ago | 2 answers | 0

2

Question

How o generate random integer value?
Example: I have used A=randi([1 10],1,12) output: A=[ 1 9 1 6 7 8 3 7 9 7 8 5] ...

11 months ago | 2 answers | 0

2

Question

how to create .dat file?
Is it possible to create a single .dat file from the following data? dataset = 2×2 cell array {1×6 double} {1×3 doub...

12 months ago | 1 answer | 0

1

Question

How to merge two cell arrays?
I have a Dataset as follows: Dataset = 4×2 cell array {1×3 double} {0×0 double} {1×3 double} {1×67 double} ...

12 months ago | 1 answer | 0

1

Question

Is there any other ways instead of using for loop for this one?
A={[10,11,10,7],[7,8,7,6],[11,10,9,9],[7,5,11,5];[9,8,6,11],[10,6,9,7],[6,12,8,9],[7,10,12,9];[10,7,12,6],[8,11,7,5],[8,5,9,9],[...

12 months ago | 1 answer | 0

1

Question

How to represent a set of matrices into a single cell?
My problem is as follows: a=4; b=4; A=round((30-10).*rand(a,b) + 10); B=round((100-40).*rand(a,b) + 40); C=round((250-80).*...

12 months ago | 2 answers | 0

2

Question

how to assign value to a specific position in cell
A={[10,11,10,7],[7,8,7,6],[11,10,9,9],[7,5,11,5];[9,8,6,11],[10,6,9,7],[6,12,8,9],[7,10,12,9];[10,7,12,6],[8,11,7,5],[8,5,9,9],[...

12 months ago | 1 answer | 0

1

Question

How to create cell followed by uniform distribution?
I need to create a cell of size n*m which will follow uniform distribution. I can easily create a cell of size 3*2 by the follow...

12 months ago | 1 answer | 0

1

Question

How can I access data from folders?
Code files = dir('H:\Project Two\Programming and DataSet'); % Get a list of all files and folders in this folder. names = ...

12 months ago | 1 answer | 0

1

Question

How do I import multiple .dat files from a folder in Matlab?
I have multiple folders such as Instance01, Instance02, Instance03, etc and each folder contains many ".dat" files which are nam...

12 months ago | 1 answer | 0

1

Question

How can a matrix of randperm be generated with variable n*m?
I want to generate a matrix of n*m size, which looks like where n=3 m=4 A=[randperm(m); randperm(m);randperm(m);] These...

1 year ago | 1 answer | 0

1

Question

How does a matrix sort based on another matrix?
I have two matries such as A=[2 3 1;2 1 3] and B=[0.2 0.15 0.1; 0.3 0.2 0.1]. Now I want to create a matrix which looks like ...

1 year ago | 1 answer | 0

1

Question

How to sort a matrix in desceding order?
I have a matrix such as: A =[ 0.8604 0.5134 0.9391 0.6482 0.3479 0.3308 0.7069 0.7640 0.0567 ...

1 year ago | 1 answer | 0

1

How to find index of the following problem?
Thank you! It works now.

1 year ago | 0

Question

How to find index of the following problem?
A={[];13;[1,5];10;7;[];8;3;5;18;[];[1,4];[2,33];[3,17];[4,37];[5,1];[6,28];[7,20];[8,15]}; B={[1 10 5]}; Output=[3;4;9] the e...

1 year ago | 2 answers | 0

2

How to check ismember in a cell in Matlab?
Thank you! It works.

1 year ago | 0

Question

How to check ismember in a cell in Matlab?
List={[5,2] [27,19] [13,8] [17,14] [3,13] [21,20] [6,16] [4,30] [1,13] [20,2] [14,27]; [5,2] [21,7] [29,6] [17,36] [35,12...

1 year ago | 3 answers | 0