Answered
Change Minimum Distance of Zero Matrix
This is a variation on the common problem of finding the length of sequences in a vector. This is typically solved by using |dif...

11 years ago | 0

Answered
how to delete diagonal values in a matrix?
One possible way: Anew = reshape(nonzeros(A'), size(A, 2)-1, [])'

11 years ago | 1

| accepted

Solved


Throw common elements of two vector arrays in sorted manner
Throw common elements as output in sorted manner (acending order) of two given input vector arrays

11 years ago

Solved


Throw common elements of two vector arrays
Throw common elements as output of two given input vector arrays

11 years ago

Solved


Find Month & day for given day number of a year
Find Month & day for given day number of a year (day number is any number ranging from 1 to 366)

11 years ago

Answered
Using the new histogram command with 'probability' normalisation
My guess is that you have another |histogram| function somewhere on your path. What does which histogram returns?

11 years ago | 0

| accepted

Answered
Is there anyway to speed this code up ??
Your code has bugs (the |vertcat| calls all have an invalid 1 as first argument, you're using |length| with arbitrary sized matr...

11 years ago | 1

| accepted

Answered
filter certain column in an array
The first thing to do is to get rid of the flat format of your file, which is not helpful for manipulating data. Reshaping the d...

11 years ago | 0

Answered
k distinct combinations of size p without replacement
Assuming |k << nchoosek(N, p)|, I would just generate random combinations until you have |k| distinct ones: function c = su...

11 years ago | 0

Answered
How can I solve these recursive equations ?
The <http://www.mathworks.com/help/releases/R2015b/matlab/ref/filter.html |filter|> function allows you to compute all your elem...

11 years ago | 0

Answered
What is the best way to get the name of a variable in a script?
No, there is no built-in function and your way is actually clever. And yes, the fact that |load| and |save| require variable ...

11 years ago | 0

| accepted

Answered
copy different cell values to a single cell
Simple: c = {zeros(1, 5); ones(1, 10); zeros(1, 15)}; %for example newc = [c{:}] This uses the expansion of cell arra...

11 years ago | 1

| accepted

Answered
I have generated a DLL from matalb model which sums two numbers and gives output. (a+b=c). How can I use that DLL in .NET C#
Are you sure that it is what you want to do? Note that at this point, your question has nothing to do with matlab anymore, and i...

11 years ago | 0

Answered
How to vectorize a function that calculates the joint stochastic matrix from individual different sized matrices to increase speed?
If all your states are single character strings, you would be better off using plain array of characters instead of cell arrays....

11 years ago | 0

Answered
Can you pls explain me the for loop here,how is it working and how is this code working >>[~, indx] = find(wd >= wd(1)*0.7)
The tilde, |~|, is used to ignore function <http://www.mathworks.com/help/releases/R2015b/matlab/matlab_prog/ignore-function-out...

11 years ago | 0

| accepted

Answered
How to read multiple binary image (same size and ROI) from a folder and find the probability of 1s in the specified region of interest?
Are you sure your images are 3D? or do you mean they are 2D with 3 colour channels? See <http://matlab.wikia.com/wiki/FAQ#How...

11 years ago | 0

Answered
How can I print a string that contains 'Escape characters'?
The simplest way is not to use the string you want to write as the format string, but as one of the argument to be formatted: ...

11 years ago | 8

Answered
hh:mm:ss string to duration type
You can get rid of the |cellfun| call, |str2double| works directly on cell arrays. The other two functions are necessary in any ...

11 years ago | 3

| accepted

Answered
Histogram - problem with X axis (shifting the data)
My guess is that since you leave |histogram| to choose its own bins, your histograms don't have exactly the same bins. You can c...

11 years ago | 0

| accepted

Solved


Find 1's Complement
Find 1's complement of a binary number For Example: x = 10011010 1's complement of x = 01100101

11 years ago

Answered
Several Operations Within a Matrix Matlab
Your output vector is really weird. Are you sure that's really what you want? Ir may be possible to achieve it without a loop...

11 years ago | 0

Answered
Convert NTP 64 format to date and time
Read it as two uint32 bytes, and use the |'ConvertFrom', 'epochtime', 'epoch'| constructor option of |datetime|: ntp64 = fr...

11 years ago | 1

Answered
Class for A = K * B in MATLAB (non-dependent properties with dependent behavior)
_"where all properties are non-dependent"_ Why? Your properties are obviously dependent, so why not use them. The warnings ar...

11 years ago | 3

| accepted

Answered
choose one out of every 8 elements randomly
One possible way: m = 1:104; %input assert(mod(numel(m), 8) == 0, 'the number of elements in m must be a multiple of 8')...

11 years ago | 1

Solved


Sum of Matrix
Sum of Matrix

11 years ago

Solved


Step up
For given input array, output a array with all elements step up by two

11 years ago

Answered
block processing to find local orientation of each block
Your code at present is just equivalent to imgBlock = gradient(imgNorm); Not really what you want. What you want to ...

11 years ago | 2

| accepted

Answered
How to generate the random number with restrictions?
Your question is not very clear, what is a random number _"as normal"_? Anyway, to get random numbers from a specific pool of...

11 years ago | 0

| accepted

Answered
How to assign values to a multidimensional array?
Probably, the easiest way is to do: stiffness_element = repmat(stiffness, [1 1 10]); stiffness_element(:, :, 2) = deltaA...

11 years ago | 0

| accepted

Answered
How can i sort data using logical indexing?
Redistributing your numbers in the row indicated by the second column is very easy with <http://www.mathworks.com/help/releases/...

11 years ago | 3

| accepted

Load more