Answered
Is it possible that we can save .m file results with different name each time of execution?
In my opinion, the best course of action is to modify the |boundary.m| function or script. Since it takes no arguments, it proba...

9 years ago | 1

| accepted

Solved


5th Time's a Charm
Write a function that will return the input value. However, your function must fail the first four times, only functioning prope...

9 years ago

Solved


"Cody" * 5 == "CodyCodyCodyCodyCody"
*Alice*: What? *"Cody" * 5 == "CodyCodyCodyCodyCody"*? You've gotta be kidding me! *Bob*: No, I am serious! Python supports...

9 years ago

Solved


Number of Even Elements in Fibonacci Sequence
Find how many even Fibonacci numbers are available in the first d numbers. Consider the following first 14 numbers 1 1 2...

9 years ago

Solved


The 5th Root
Write a function to find the 5th root of a number. It sounds easy, but the typical functions are not allowed (see the test su...

9 years ago

Answered
How to apply two sliding concentric windows a 3-by3 and 6-by-6 to calculate mean at that point?
mean3 = conv2(yourgreyimage, ones(3)/9, 'same'); %mean over 3x3 window mean6 = conv2(yourgreyimage, ones(6)/36, 'same'); %...

9 years ago | 1

| accepted

Answered
How to have the length of the words in each line
I wouldn't use textscan for that. Probably the easiest would be: [wordstarts, wordends] = regexp(yourtext, '\w+'); wordle...

9 years ago | 0

| accepted

Answered
Creating Chart with Excel (ActiveX)
A lot of VBA examples on the net use Activexxx to refer to various objects. It always befuddles me since that breaks easily (som...

9 years ago | 0

| accepted

Answered
Conversion to double from struct is not possible.
As has been said and will keep being said, using globals is a mistake. While it may work fine for now with your simple code, it ...

9 years ago | 1

Answered
how tho get the corners of an unknown matrix?
It's really basic indexing: [x(1), x(1, end) x(end, 1) x(end) ]

9 years ago | 2

| accepted

Answered
Error using reshape To RESHAPE the number of elements must not change.
I don't see how the code shown can result in the error stated. Note that another way to write your first reshape is: im...

9 years ago | 2

Answered
Error using vertcat Dimensions of matrices being concatenated are not consistent.
If you want to apply your |yes| formula to each element of |Zt| then you have to use a loop, or |arrayfun|. Using |arrayfun|:...

9 years ago | 0

Answered
How to assign variable width bins in histogram?
Calculate the edges of your bins according to your other data sequence, pass that as the second input of |histogram|.

9 years ago | 1

Answered
how to take just 4 digits after point value
round down to 4 decimals: vec2 = round(vec1, 4); display with remaining zeros: format long vec2 I personally ...

9 years ago | 1

| accepted

Answered
Problems with while. The program is blocked
Disclaimer: I've never used the app designer. Maybe mathworks have changed how things work compared to the 'old' gui tools. M...

9 years ago | 0

Answered
eval([ans '=' num2str(x0(i)) ';']); gives an error "The expression to the left of the equals sign is not a valid target for an assignment". what could be the problem?
There are many thing wrong with eval([ans '=' num2str(x0(i)) ';']) * |eval| expect a string or char array. As per Mischa...

9 years ago | 2

Answered
why temp command is required
|temp| is a poor name for a variable. It's obviously a temporary variable used to calculate something but it doesn't tell you wh...

9 years ago | 0

Answered
How to insert zeros in matrix randomly?
A = [2, 1, 4, 6, 2; 9, 4, 6, 1, 2; 5, 3, 2, 8, 3; ...

9 years ago | 0

| accepted

Answered
How to load specific files according to vector values?
First thing, use better variable names. |ii| is really bad, it does not mean anything and looks like a temporary variable. Let's...

9 years ago | 0

| accepted

Answered
Finding the values right after and right before some values in a matrix
An alternative method that does not involve loops (or |arrayfun|) but is not necessary faster than KL's: comp = abs(A(:, 1)...

9 years ago | 0

Answered
finding rbg color values from color map
All you need to do is interpolate your values according to your |caxis| and |colormap|, bearing in mind that value outside the |...

9 years ago | 2

| accepted

Answered
Inappropriate MATLAB warning when summing over columns
The warning is entirely accurate, if you want |sum(X)| to sum across the rows whether or not |X| is a vector (i.e. |sum| will al...

9 years ago | 1

| accepted

Answered
how to implement lookup table in matlab code
It's puzzling that you're even asking the question. Maybe you have a strange definition of a look-up-table. In any language, a l...

9 years ago | 1

Answered
Imshow vs mesh: Filter response flipped?
By convention for images the origin is the top left corner and the y axis points down. You can see that clearly if you make the ...

9 years ago | 1

| accepted

Answered
How extract sub matrix without zeros from a big matrix
If I understood correctly: %N: your big matrix rowswithnozeros = cellfun(@(row) nonzeros(row).', num2cell(N, 2), 'Unifor...

9 years ago | 1

Answered
Better solution than mod() while indexing
Put the last colour first: colors = [colors(end), colors(2:end-1)]; Then, simply mod and add 1: color = colors(mod(...

9 years ago | 0

Answered
I have matrix A =[nx1] & B = [nx1] I want to combine them into C = [ nx2]
The title of your question has nothing to do with the body of your question. To answer your title: C = [A, B]; To ans...

9 years ago | 1

| accepted

Answered
How to multiply values in a cell by a vector?
_Where did I go wrong?_ Despite your statement, at least one of the matrix or vector in your cell array does not have the sam...

9 years ago | 0

| accepted

Answered
Create a Gray level Mask using Matlab and write the same as a gray level image.
Basically, the *class* of the image is crucial to matlab when saving to file (and displaying images). Matlab assumes that the in...

9 years ago | 0

Answered
How to replace repeating no.s in an array by distinct no.?
If I understood correctly: A = [7,6,3,5,3,6,6,2,9,6] [~, ~, subs] = unique(A); idxtoreplace = accumarray(subs, (1:num...

9 years ago | 0

Load more