Answered
How to get diagonal elements of non-square matrix?
What you want effectively is the values on the line going from one corner to the other. If you have the image processing tool...

9 years ago | 0

| accepted

Answered
How to select only the most central object in a binary image
_"I thought the easiest way to do this would be to delete any coins except the most central one"_. And how are you going to do t...

9 years ago | 2

| accepted

Answered
show image in axes in serial callback function
Your code does not show how the |handle| structure gets created. Also, I don't see how what you've shown could even work since y...

9 years ago | 0

| accepted

Answered
How to get the real-time position of mouse outside matlab
By default (on Microsoft Windows at least), a window only receive mouse move events when the mouse is within that window. While ...

9 years ago | 1

| accepted

Answered
How to fix "Subscripted Assignment Dimension Mismatch" and other potential errors
I assume you're using R2016b or later, otherwise the error you'd get would be different. Was the code written for an earlier ver...

9 years ago | 0

Answered
How to pre-allocate changeable size arrays in a for-loop?
I'm with Adam and Dhruvesh, your code is very difficult to parse. Better indentation (select all code and press CTRL+I), more wh...

9 years ago | 1

| accepted

Answered
how to call a get.properties method in a script
You have two problems: 1. You're using the wrong syntax for accessing properties. Regardless of the syntax used to define the...

9 years ago | 0

| accepted

Answered
sortrows command doesn't sort numbers properly
I see no numbers. What I see are char arrays whose characters happen to be digits. As with any string, matlab sort these alphabe...

9 years ago | 2

Answered
How to us variable as an if statement condition?
if somecondition comparisonop = @le; %le is the function name for <= else comparisonop = @ge; %ge is the func...

9 years ago | 1

| accepted

Answered
Matlab "missing" values not clear
_what type of value is "missing"_ From the user point of view it's a flag for missing data. How it is implemented should not ...

9 years ago | 0

| accepted

Answered
I like to arrange the pixels intensity based on the sequence in the matrix
This is probably the logic: Y = [ 5 4 4 2 ; 6 3 3 1 ; 2 4 2 2; 5 5 6 1] [values, ~, loc] ...

9 years ago | 2

| accepted

Answered
Matlab find unique column-combinations in matrix and respective index
More or less the same as Jan's, using |accumarray| instead of |splitapply| (I'm still old school!): A = [ 1 2 3 ...

9 years ago | 3

| accepted

Answered
trignonemetric second derivatives of a 2x20001 matrix
I'm not sure what you're trying to do. You are calling the <https://www.mathworks.com/help/matlab/ref/diff.html |diff|> function...

9 years ago | 0

Answered
Why I received following msg: "We are unable to offer you a trial. If you believe you are receiving this message in error, please contact your local customer support representative" ?
The only way for you to know the answer to your question is to do what the message tells you and *contact your local customer su...

9 years ago | 2

| accepted

Answered
How to "smear" a logical mask without looping
And here is a one liner that also works regardless of the numbers of ones in each column: %a: logical matrix %n: number ...

9 years ago | 1

Answered
Join 2 tables with different values in the key variable
The way I would do it: d = B.Var1 - A.var1'; %requires R2016b or later d(d < 0) = Inf; [~, idx] = min(d); A.var2 ...

9 years ago | 1

| accepted

Answered
How do i resolve the error in this code
The only way you can get this error is if one or both of |C| or |r| is not scalar. So what is size(r) size(C) Your eq...

9 years ago | 0

Answered
"The file has been modified outside of MATLAB Editor. Do you want to reload it?" error. How to repair that?
There is probably an issue with your network drive where the modification timestamp on the file keeps changing, hence why matlab...

9 years ago | 0

| accepted

Answered
Dividing image into 2x2 blocks and calculating SSIM for each block.
Assuming that the size of the image is a multiple of the window size (which as Image Analyst pointed out probably needs to be bi...

9 years ago | 0

| accepted

Answered
How to "smear" a logical mask without looping
This would work regardless of the numbers of non-zero values in each column. The loop is only over the length of the smear, so s...

9 years ago | 1

Answered
Make unequally spaced data x,y equally spaced
newx = x(1):min(diff(x)):x(end); newy = interp1(x, y, newx);

9 years ago | 0

| accepted

Answered
Variable "x" change size with every loop iteration, and obtaining equally spaced values.
_It won't compute because it tells me "variable 'x' appears to change size with every loop iteration"_. Yes it will, this is jus...

9 years ago | 1

Answered
how to download this software in 32-bit system
You can either: * Upgrade your OS to 64-bit * Downgrade to matlab R2015b, the last matlab version to support 32 bit. whic...

9 years ago | 2

| accepted

Answered
I am a beginner in matlab. So, Could anyone please help me to create an adjacency matrix based on this attached dataset? This set consists of nodes and edges, so I want adjacency matrix where 1 represents connected nodes otherwise 0.
Once you've imported your data, the <https://www.mathworks.com/help/matlab/ref/graph.html |graph|> and <https://www.mathworks.co...

9 years ago | 0

| accepted

Answered
Appearance of small matrix in the workspace and structs
Unfortunately, there is no option to customise the display of the variable editor.

9 years ago | 0

| accepted

Answered
Split string of hex shorts into cell values
Simply reshape the string into 4 columns, pass it through |dec2hex| and account for the fact that |dec2hex| assumes unsigned int...

9 years ago | 0

| accepted

Answered
Extract a specified interval of numbers from a multidimensional array
Note: calling your variable |error| may not be wise, as it'll prevent you from using the <https://www.mathworks.com/help/matlab/...

9 years ago | 1

| accepted

Answered
convert a matrix in a struct
You haven't attached your data. The following may do what you want: datasize = numel(userTouristicTraj(1).touristicData); ...

9 years ago | 1

| accepted

Answered
I have an array of 1000 elements I need to do average of 100 elements so that my new array is of 10 elements...
reshape your array into 100 rows, take the mean across these 100 rows: assert(mod(numel(yourarray), 100) == 0, 'number of e...

9 years ago | 1

Answered
How to update guidata in the addlistener callback function?
Note: for i = 1:10 checkbox(i-1) = ... will error on the first iteration, since |checkbox(1-1=0)| is not a valid i...

9 years ago | 1

| accepted

Load more