Answered
How I generate a random number between 300 and 450?
_I would like to generate a number between 300 and 450_ _I tried to use |poissrnd| but I couldn't generate a number between t...

9 years ago | 0

Answered
zeros before a string using num2str
The problem with your format string is not the |%0| which would work fine, had the next number been correct. The |3| is the prob...

9 years ago | 3

| accepted

Answered
How to write image
images of class double in matlab are assumed to have intensity range 0-1, with 0 == black, 1 == white.You get a white image beca...

9 years ago | 0

Answered
How to split command signal arrays in command order sequence?
I'm not entirely sure what you're asking, but if you want to split that vector, it's simply: a = mat2cell(A, 1, diff([0, fi...

9 years ago | 0

Answered
How to find set of 3 in a 122x4 matrix?
This is O(n^2) so is going to be slow for largish matrices. I haven't got the time to think of a cleverer algorithm: pairs ...

9 years ago | 0

Answered
From array to a file
csvwrite('C:\somewhere\somefilename.txt', reshape(yourarray, 4, []).'); would be one way. Assuming that the number of eleme...

9 years ago | 0

Answered
How do I convert a string to a single quotes string?
_single quote string_ is actually a char array. They were the only kind of strings available pre-R2016b. Anyway, to get a char a...

9 years ago | 1

Answered
vector of same size equality
What is the difficulty? if isequal(a, b) disp('Vectors are equal'); end

9 years ago | 0

Answered
Getting MD5 hash of files with "bad" names (Windows, NTFS)
As others have pointed and as <https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_convention...

9 years ago | 2

Answered
Reverse character array using recursion
I assume this is homework so I'm hesitant even answering the question since the whole purpose of the exercise is to make you thi...

9 years ago | 0

| accepted

Answered
how to solve this issue?
_If I use this line I will get structure like Struct_Pdu_1_ a) you don't get a <https://uk.mathworks.com/help/matlab/structur...

9 years ago | 0

| accepted

Answered
find all the possible pairs with postive elements from a given matrix
Another way to open the same result: A = [0.1 -1.5 -0.1; -5.2 1.7 1.8; 2.9 -3.1 0.1]; B = cell...

9 years ago | 3

Answered
How do I properly append to an array within a loop?
If all you're trying to do is accumulate the values of |ia_time|, then A = cumsum(ia_time); If you really wanted to use a...

9 years ago | 4

Answered
Using 'find' for finding whole numbers
_I use this command |R = find(lat_grid <= lat,1,'first')|. This works fine for floating numbers_ No, it doesn't work. If it h...

9 years ago | 0

Answered
Matrix multiplication with each other.
yourvector(1:2:end) .* yourvector(2:2:end) or prod(reshape(youvector, 2, []))

9 years ago | 1

Answered
Find minimum of first column of matrix among multiple cells and then second and so on..
Since all the vectors are all the same size, why are they stored in a cell array. Simpler would be to convert that cell array to...

9 years ago | 1

| accepted

Answered
How to delete element from a vector in the beginning and last part of my signal
Note: A good way to find out what is going wrong with your code is to use the <https://uk.mathworks.com/help/matlab/matlab_prog/...

9 years ago | 0

| accepted

Answered
How to get 2D matrix from a 3D without getting NaN
All your code is doing is copying |INT_norm_A(114,102,:)| into |x|. The loop is useless since it overwrites |x| on each step. ...

9 years ago | 0

Answered
How to create a table and add elements to the table in MATLAB?
If you do want to create tables as opposed to datasets, here is how I'd do it: states = 0:8; rownames = compose('%d', st...

9 years ago | 0

Answered
Deletion of cell array element performance issue - alternative or solutions?
Cell array and matrices are very efficient for indexing (O(1) complexity) but innefficient for insertions and deletions (O(n) co...

9 years ago | 1

Answered
Skipping lines in text file
Most likely, you could read the file very simply with: t = readtable('Acc.txt'); which, if the first line is a header, s...

9 years ago | 1

| accepted

Answered
save maximum column to excel
file(col_no); does nothing. It asks for the col_no'th element of file and doesn't put it anywhere. Then, with csvwrite...

9 years ago | 0

Answered
How do I combine information from 2 arrays into a single array?
You would be much better off converting your hours and minutes to a <https://www.mathworks.com/help/matlab/ref/duration.html |du...

9 years ago | 0

| accepted

Answered
random presentation of the columns of a matrix
First, a simpler way to generate your matrix: trialType = [1 2 3]; Examples = [4 5 6]; [c1, c2] = ndgrid(trialType, E...

9 years ago | 0

| accepted

Answered
If-statements within a for loop does not respond to my counter appropriate?
|a<x<=b| is not doing what you thing it's doing and is not the way to check that a number is between two numbers. What it does i...

9 years ago | 1

| accepted

Answered
How to extract this vector ?
Assuming you mean the antidiagonal of the matrix: diag(fliplr(A))

9 years ago | 0

Answered
hilbert without signal processing toolbox
Have you searched the <https://www.mathworks.com/matlabcentral/fileexchange/?term=hilbert FileExchange>?

9 years ago | 0

Answered
datetime 'InputFormat' syntax
Without seeing the actual format of |time|, it's difficult to know what the correct format should be. However, it's unusual to h...

9 years ago | 0

| accepted

Answered
Split legend after blank space
Just use |strrep| to replace the spaces by a linefeed (char(10)): legend(strrep(Title, ' ', char(10)));

9 years ago | 0

| accepted

Answered
Could somebody explain the code by Elias Wegert to me?
The error message occurs because some elements of |f| are |Inf + 1i*Inf|, which when multiplied by 0 give |0 + 1i*NaN| (I would ...

9 years ago | 1

| accepted

Load more