Answered
Subtract average image from a series of images
In view of the error, I would suspect that you're trying to subtract your mean image from a variable called exactly |image|. Unf...

11 years ago | 0

| accepted

Answered
average of field in a structure with an if condition
It's not clear if your |S| is a structure array with scalar fields: S = struct('a', {2; 0; 1; 2}, 'b', {4; 6; 5; 3}) mea...

11 years ago | 0

| accepted

Answered
How to group variable of interests by logical indexing?
First, you're not using logical indexing in your code because of the |find|. The exact same code without the call to find (i.e. ...

11 years ago | 0

| accepted

Answered
How to read a txt file and put data like this?
This will probably work: filecontent = fileread('c:\path\to\your\file'); %read the whole file colvalues = regexp(fileco...

11 years ago | 0

Answered
readtable - command - which version of Matlab
tables and the <http://www.mathworks.com/help/matlab/ref/readtable.html |readtable|> function were introduced in R2013b.

11 years ago | 1

Answered
Save loop data to a matrix
To do exactly what you asked: p = [1,2,3;4,5,6]; U = zeros(size(p, 2)*2, 3); for i = 1:size(p, 2) %don't use hardcod...

11 years ago | 0

| accepted

Answered
MATLAB Cody Coursework Help
I'd use <http://www.mathworks.com/help/matlab/ref/datetime.html |datetime|> instead of |datevec|. It makes this sort of calculat...

11 years ago | 0

Answered
how to change datatype of libpointer
setdatatype(pointer, 'uint16Ptr', n); %assuming the pointer points to an array of n uint16 should work.

11 years ago | 1

| accepted

Answered
How to use reshape function in this situation ?
Forgetting about the shape for the moment, in order to execute a dot product each argument must have the same number of elements...

11 years ago | 0

Answered
Function 'subsindex' is not defined for values of class 'struct'. Error in decoder_test (line 18) binpix= de2bi(stego(key(i)),8);
key = load('key.mat') This will create a <http://www.mathworks.com/help/matlab/structures.html structure> |key| with fields...

11 years ago | 0

Answered
Error Using * and ^
Before you go any further, you *must* learn and understand the difference between dotted and non-dotted operators as per <http:/...

11 years ago | 1

Answered
how to write this data into a sparse matrix
columns = {[12 1 2 3 4 60 61 62 63 89 90 91 95] [4 32 33 34 35] [3 83 84 91] [18 39 40 41 42 43 71 72 73 7...

11 years ago | 0

| accepted

Answered
Drawing rectangles using matrices.
Considering your rectangles are aligned with the side of the image, all you have to do is fill two rows and two columns with 1: ...

11 years ago | 0

Answered
how can i know how a binary image look like just from knowing the histogram ? (image processing)
Of course, it's not possible. Once you've got rid of information, you can't magically recreate it. What you're asking is equi...

11 years ago | 0

Answered
How to pick points in outer annulus of a matrix?
Please don't put blank lines between each line of code. Instead use the *{}Code* button to mark text as code. Also rather tha...

11 years ago | 0

| accepted

Answered
MATLAB code that reads in an logic code input file
_"a text input file containing basic user-defined logic code (ie, if-then-else, while-do, etc)"_ is the definition of a m-file. ...

11 years ago | 0

Answered
Explicitly numbered string?
My recommendation is to use <http://www.mathworks.com/help/matlab/ref/sprintf.html |sprintf|> which lets you compose any arbitra...

11 years ago | 1

Answered
How to search row and delete row?
Either of these would work: value = y(~all(bsxfun(@eq, y, x), 2), :) Or value = y(~ismember(y, x, 'rows'), :)

11 years ago | 1

Answered
Changing point coordinates in a file to closest ones in another file
If you have the statistics toolbox, you can use <http://www.mathworks.com/help/stats/pdist2.html |pdist2|> to calculate your dis...

11 years ago | 0

| accepted

Answered
New to matlab, I don't know how to solve this problem.
_My problem is I don't know how to get a 2×5 matrix from an array._ This is very basic matlab: v = [1 pi -6 42 0] %an arra...

11 years ago | 0

Answered
How to specify the input folder location and save output in specified folder
Use <http://www.mathworks.com/help/matlab/ref/fullfile.html |fullfile> to build paths: sourcefolder = 'C:\some\folder'; ...

11 years ago | 0

| accepted

Answered
How to send vector of string to MATLAB compiled DLLs, using mwArray?
Yes, <https://isocpp.org/wiki/faq/const-correctness#constptrptr-conversion C++ will not let you convert T** to const T**>. While...

11 years ago | 1

| accepted

Answered
Conditional / If Statements not running
Maybe if you'd use indentation in your program, you'd have seen straightaway what it is doing. This is your code with proper ind...

11 years ago | 0

| accepted

Answered
I am trying to implement chain code starting from a pixel where intensity value is one I am successfully getting its chain code as 7 and my new co-ordinate should be this point but instead of this updation is not going on this way instead I am gettin
Well, you have a |while| loop that runs if |x| or |y| are within a certain range. Within that loop, you never modify |x| or |y|,...

11 years ago | 0

| accepted

Solved


Convert integer to base26 using letters
Write a function that converts a decimal integer to base26 using the letters of the english alphabet, i.e. 0->'a', 1->'b', 2->'c...

11 years ago

Solved


Volume of a cube
Find the volume of a cube.

11 years ago

Solved


Odd elimination
Inspired by Project Euler problem #539 You'll be given a vector from 1 to n; Going from left to right, remove the first n...

11 years ago

Answered
how to use bsxfun or arrayfun to build the following matrix
Neither arrayfun nor bsxfun are useful for this. <http://www.mathworks.com/help/matlab/ref/sub2ind.html |sub2ind|> is: P = ...

11 years ago | 0

| accepted

Answered
How can I change all negative angles in 20 x 5000 cells to positive? i.e. -167deg. to 193deg.
The <http://www.mathworks.com/help/matlab/ref/mod.html modulo> operation is your friend: angles = [-167 0; 90 -270] %for e...

11 years ago | 1

| accepted

Answered
find unique rows of cell array
This is possibly more efficient than the other solutions: [r1, r2] = ndgrid(1:size(matching__, 1)); duplicates = any(tri...

11 years ago | 1

| accepted

Load more