提问


apply a function to every element of a square matrix
I have a square matrix and I would apply a function to every element of that matrix in the way I get a new square matrix where e...

12 years 前 | 3 个回答 | 0

3

个回答

提问


building a matrix starting from another matrix
I want to build a square matrix. Let's suppose We have this matrix called nodes 1 4.3434 3.4565 2 6.2234 5.1234 3 1...

12 years 前 | 1 个回答 | 0

1

个回答

提问


indexing a square matrix in the best possible way
I have a square matrix and I would check some condition of every element of it.which could be the best way to indexing a square ...

12 years 前 | 3 个回答 | 0

3

个回答

提问


fill a vector inside a cycle
I have a script where I have to fill a vector like this example: heads = (1:10); vector_to_fill = zeros(1,5); for i...

12 years 前 | 1 个回答 | 0

1

个回答

提问


how preallocate structure for better memory
I had created a structure made so: head.number = 3; head.pck_rcv = [1 0 0]; heads(2).number = 5; head(2).pck_r...

12 years 前 | 3 个回答 | 2

3

个回答

提问


store values in a certain way
I would store values in a certain way like this: For example I have values as [2 3] to this values I would connect to 2 a vec...

12 years 前 | 1 个回答 | 0

1

个回答

提问


preallocate vector or not
I'm doing a simulation and I initialize a vector that will contain during the simulation integer values. At the beginning I don'...

12 years 前 | 3 个回答 | 0

3

个回答

提问


find index of a matrix through another matrix
I have this matrix A = [1 3 4 6 7] and B = [3 4] that it's a subset of A matrix. For example I would find the index of B matrix ...

12 years 前 | 3 个回答 | 0

3

个回答

提问


same values using randi setting seed as default
I'm using randi to generate rand integer valeus but I get the same values two times in my vector. example rng default; f...

12 years 前 | 5 个回答 | 0

5

个回答

提问


enter in the if clause only in certain situation
I would execute a block only if I have this vector A=[1 0] instead if I'd have A=[0 0] or A=[1 1] if clause shouldn't be...

12 years 前 | 1 个回答 | 0

1

个回答

提问


how to create while statement
I'd create while statement that should works like: A is an column vector while [every A element is not equals to 1] ...

12 years 前 | 1 个回答 | 0

1

个回答

提问


there is a way that if clause it is execute
Here it is a piece of code: x = rand; if x < 1E-6 do-something end if I execute this piece of block in l...

12 years 前 | 1 个回答 | 0

1

个回答

提问


find if a column vector contains at least element 1
I have to check if column vector has at least element 1. Does Matlab have such similar function or I have to build it myself?

12 years 前 | 2 个回答 | 0

2

个回答

提问


rand integer values from an array
I have an array that contains some integer. i.e A=[1 5 7 9] I would choose a rand value from this vector. Which cou...

12 years 前 | 1 个回答 | 0

1

个回答

提问


best way to enter only one time in a if block
I have a for cycle for n= 1: 100 x=rand()*10; if x > 5 do something end end When I exec...

12 years 前 | 1 个回答 | 0

1

个回答

提问


obtaining values major than 10e-7
I use rand function to generate values x = rand; after that I compared generated values to 10e-7 if x > 10e-7...

12 years 前 | 1 个回答 | 0

1

个回答

提问


Obtaining same values at avery simulation using rand function
I'm building some simulations with matlab and I use rand function. I would obtain at every run, the same results. I read somewhe...

12 years 前 | 3 个回答 | 0

3

个回答