Answered
How to pass an argument for a function when it is an argument in another function?
_"Is there anyway to do this?"_ Yes, it's call argument binding. In matlab, this is achieved by defining an anonymous functio...

8 years ago | 0

Answered
Is it possible to save an output image from a program in .jpg format in a folder?
Almost anything is possible as long as you write the code for it. Writing images in matlab is done with <https://www.mathworks.c...

8 years ago | 1

| accepted

Answered
Extending the values of a vector
A=[2 14 6 18 9 10] half1 = arrayfun(@(v) randi(v-1), A); full = [half1, A-half1] result = full(randperm(numel(full)))...

8 years ago | 1

Answered
Matlab Exchange - More authors to one contribution
If you are talking to submissions to the FileExchange, then only one account can be the owner of the submission. So, yes if you ...

8 years ago | 0

Answered
Any alternative to using the eval command
save(sprintf('ADCP%d', k), 'U', 'V', 'W');

8 years ago | 1

| accepted

Answered
Is it possible to convert RGB (of data type uint32) to HSV?
Simply convert your uint32 image to double (in the range [0-1]): hsvvalues = rgb2hsv(double(your_uint32_image) / intmax('ui...

8 years ago | 0

Answered
finding logical index greater than 25
sequencestarts = [1, find(diff(yourlogicalvector))]; %assuming a row vector sequencelengths = diff([sequencestarts, numel(...

8 years ago | 0

Answered
How do I create a corresponding array of indices that maps the sorted array of butter amounts to the original toast thicknesses and areas?
If I understood correctly, [mapArr, order] = sort(breb, 'descend'); sortArr = toastThickness(order);

8 years ago | 0

Answered
Double for loop in a random walk. How do I loop over all particles simultaneously instead of looping the amount of steps for each separate particle one at a time?
If you want to change the order of the loops, then your |x_t| and |y_t| need to be 2d matrices x_t = zeros(M, N+1); y_t ...

8 years ago | 1

| accepted

Answered
Standard Atmosphere table: how can i use the initial values of one section, which are the last ouputs of the last one?
I don't really understand your question. From step 12 to 25 your code already use |T(12)|, |p(12)| and |d(12)| in the right hand...

8 years ago | 0

Answered
deleting specific rows in an array based on values in another array
vector_1(vector_2 == 777) = []

8 years ago | 2

| accepted

Answered
How do I fprintf certain numbers from a matrix?
fprintf('%d\n', arrayYears(checkYears == 0))

8 years ago | 0

| accepted

Answered
How to delete certain rows of a table based on time
h = hour(yourtable.DateTime); m = minute(yourtable.DateTime); filteredtable = yourtable((h == 8 & m >= 25) | (h == 9 ...

8 years ago | 0

| accepted

Answered
get the table from uitable into a matrix A
Your |uitable| returns a cell array because you've defined the first column as char. If your |uitable| is supposed to contain nu...

8 years ago | 0

| accepted

Answered
For loop problem (Help)
As far as I can tell the only difference between the two branches of the |if| is the value of |Status|, so a better way of writi...

8 years ago | 0

| accepted

Answered
How to use any size array as an input?
If not for the bugs, your function would work for *vector* inputs of any size (but not matrices or arrays, i.e. anything with 2 ...

8 years ago | 0

Answered
how to find mean absolute deviation image?
I don't see what's difficult about that. Assuming an greyscale image: mad = mean(abs(yourimage(:) - mean(yourimage(:))))

8 years ago | 0

Answered
Merge multiple .csv files of different dimensions into one data
Assuming all the files have the same number of columns (otherwise you need to explain what to do with the files with less column...

8 years ago | 0

Answered
How to find the sequences with length bigger than n in a vector?
v = [1 2 3 4 5 6 7 10 12 16 17 18 19 20 21 24 25 30 31 32 33 34 35 36] minlength = 6; isconsecutive = diff(v ) == 1; ...

8 years ago | 1

| accepted

Answered
Comparing elements of two matrices
Afiltered = setdiff(A, B)

8 years ago | 1

| accepted

Answered
can I convert multiple png images to bmp images in matlab without effect on the quality of the images?
That depends on the png images. The png format supports a lot more image formats than bmp. A png image can be up to 16 bits per ...

8 years ago | 0

Answered
splitting and matching elements in excel
desiredrecipients = [12 13 14]; desireddonor = 1; desiredstate = 'Healthy'; t = readtable('TestHealthy.xls'); %rea...

8 years ago | 1

| accepted

Answered
Matrix must agree HELP
|y|, |pp|, etc. are obviously at least 2D, so |length| of these can be the number of rows or columns depending on the matrix, wh...

8 years ago | 0

Answered
How do I avoid getting fooled by 'implicit expansion'?
Yes, some complain about implicit expansion. For me, it's a logical expansion (pun intended) of the 1-D scalar expansion to N-D....

8 years ago | 3

Answered
How to scan an image to find out the row or column that will be the first background pixel?
As pointed out by Walter, background is normally black, so you need to invert the image. Finding out the centroid is trivial wit...

8 years ago | 0

| accepted

Answered
Comparing two files of dissimilar sizes
file1 = dlmread('c:\somewhere\file1.txt'); file2 = dlmread('c:\somewhere\file2.txt'); tokeep = ismember(file2(:, 3), fil...

8 years ago | 0

Answered
Reshape matrix to have the same value every 30 cells
This is not a |reshape| it's a |repmat|: repmat(A, 1, 30)

8 years ago | 1

| accepted

Answered
hi everyone , how can I built a matrix of circularly shifted array in efficient way
To be compared to a loop version, it's very possible that a loop is faster: array = [2, 0, 0]; shiftidx = hankel(1:numel...

8 years ago | 0

Answered
ycbcr to grayscale??
Note that there are <https://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale many ways> of converting colour to gr...

8 years ago | 1

| accepted

Answered
how to count number of values exceeding given threshold in moving window
If I understood correctly: v = [1 2 3 4 5 6 5 4 3 2 1 2 3 4 5 6]; %demo data threshold = 4; windowsize = 5; a...

8 years ago | 2

| accepted

Load more