Answered
How can i substitute my for loop with something faster?
The hwindow calculation could certainly be performed before the loop since it's constant for all i. That would speed things up m...

8 years ago | 1

Answered
Cell array to Matrices
You already have your C1, C2, ..., C512 in a very convenient container making it very easy to access: your cell array. Assuming ...

8 years ago | 0

| accepted

Answered
Create uncompressed movie from sequence of 11-bit grayscale images
I've just done some testing with some dummy uint16 images whose pixel values are in the range [0 2047] simulating an 11-bit pixe...

8 years ago | 1

| accepted

Answered
access properties from an array of objects as an array?
find([obj.a] == 3) This assumes that |a| is scalar for all elements of array |obj|.

8 years ago | 0

| accepted

Answered
How do I sum over multiple dimensions? I want my final result to be a average with respect to area not the number of grids.
mean(yourarray(:)) No need to use |sum| to calculate the mean.

8 years ago | 0

Answered
How can I connect and then, merge the different regions in binary image?
<https://www.mathworks.com/help/images/ref/imclose.html |imclose|> is probably what you're looking for.

8 years ago | 0

Answered
How to separate table columns by groups?
If |Var2| is a categorical array, then I assume that your |xyz,xyy| is actually a 1x2 categorical array |[xyz, xyy]|, not a char...

8 years ago | 1

| accepted

Answered
Indexing result of strsplit('My string', ' ')
No matlab does not allow indexing directly into the return value of a function (or any other temporary variable). There is not w...

8 years ago | 2

| accepted

Answered
Separating an undetermined cell plot
It seems to me that you do not know how to manipulate cell arrays and perhaps do not understand cell arrays very well (for examp...

8 years ago | 0

| accepted

Answered
How can I move columns with different numbers of rows into an excel file as a table
First, a simple function to concatenate column vectors into a cell array (with empty cells for the shorter vectors): functi...

8 years ago | 0

Answered
Why does any error appear according to complex of a function?
global variables are a major source of bugs and it is very hard to track who creates or modify them. Avoid global variables. ...

8 years ago | 0

Answered
plot not saveable, if it displays multiple functions
image = plot(... |plot| does not return an image so your variable name is very misleading. It returns Line objects. I'm sup...

8 years ago | 1

Answered
Clearing errors in executing GLCM matlab code
|graycomatrix| is a function in the image processing toolbox. However, when your code attempts to call this function it finds a ...

8 years ago | 0

Answered
How to add final value of a loop part to the next one. i need to add the months answers of ii=1 to ii=12
What is the purpose of |Xs| ? *Do not number variables*. If you're numbering variables that is a good indication that you sho...

8 years ago | 0

Answered
My script sees the value 2 different then 2.0000 which is a problem
*You cannot compare floating point numbers obtained through different methods with ==*. This is true for all computer languages....

8 years ago | 1

| accepted

Answered
I have a string of DNA bases and I need to count the number of times I have two identical bases at a certain distance from each other.
sum(regexp(yourchararray, 'A[^A]{0,2}A')) 2 being the maximum distance between two A (and 0 the minimum). The regexp says m...

8 years ago | 0

| accepted

Answered
How to find the successive difference between timestamps in hours?
d = datetime(yourdatenumvector, 'ConvertFrom', 'datenum'); %convert to the more useful datetime sum(hours(d(2:2:end) - d(1:2...

8 years ago | 0

| accepted

Answered
How do I create a vector of n consecutive numbers spaced at with an interval of m between each group, without using a for loop?
numconsecutive = 3; %let's use better names than n, m, etc. groupspacing = 2; numgroups = 5; v = reshape((1:numcon...

8 years ago | 0

| accepted

Answered
Use logical values to extract a matrix not a vector?
This is going to break in all sort of interesting ways if your logical array wouldn't result in a square matrix. Detecting such ...

8 years ago | 1

Answered
Finding the curvature of a 2nd degree equation
Not sure what a second degree equation is. Is it a quadratic curve? Anyway, the wikipedia article on curvature gives you the...

8 years ago | 0

Answered
retime 'regular' is not a valid specification of target time vector for synchronization.
The |'regular'| option of |retime| was introduced in R2018a. You'll get this error if you're using any earlier version.

8 years ago | 1

Answered
How to configure which WI-FI interface to use when calling tcpclient function
_I need to do this because both interfaces have an IP address of 192.168.1.1_ That's never going to work, in matlab or in any...

8 years ago | 0

| accepted

Answered
please solve the below error
_Unable to read file 'repressilator_oscillations.dat'. No such file or directory._ What more is there to say? You try to load...

8 years ago | 1

Answered
Why MEX cannot find library 'm' specified with the -l option?
I assume you're following some instructions in order to compile some mex library. Clearly, from the format of the paths the inst...

8 years ago | 0

| accepted

Answered
make C code to be a matlab code about LCM, please help me
_if I'm wrong_ Why can't you find that out yourself by testing your code with a few different values? Have a look at the d...

8 years ago | 0

Answered
Plot 2 matrices in one graph with 3 axis
If your calculate functions can operate on matrices: [pct, ptx] = ndgrid(n); CR = yourcalculateCRfunction(pct, ptx); ...

8 years ago | 0

Answered
How to dynamically change the value of step in a loop to avoid double counting?
A bit confused over what constitutes a valid event/breakpoint pair but this should get you started. Adjust as appropriate: ...

8 years ago | 0

Answered
How to do Cell Indexing the same way we do Matrix indexing
_Why isn't this working?_ Because cell arrays are not matrices and are not meant to be used as matrices. Putting scalar value...

8 years ago | 0

Answered
Force MatLab to probe the number of currently available physical screens.
_MatLab fails to notice that a screen was plugged_ More accurately, the *psychotoolbox* fails to notice ... The psychotoolb...

8 years ago | 0

| accepted

Answered
reducing computational time by removing global variable
function [bin] = front(a, b, IM, Lx, Ly) if IM(a,b)~=IM(1,1) %... rest of code as it was end Then in your...

8 years ago | 0

| accepted

Load more