Answered
How to open a dialogue when clicking on a push button in gui?
In the callback function for your button, you can make use of the *inputdlg* function to display a dialog that will query the us...

12 years ago | 0

Answered
uigetfile and getting Matrix from .txt file
Yes, your output is correct given the format string that you have provided to the *textscan* function. From <http://www.mathwor...

12 years ago | 0

Answered
Generating a Plot For a Function, HELP
David - the code is getting stuck due to its recursive nature. The line fplot(myfun(-10:10),output) calls itself, passi...

12 years ago | 0

| accepted

Answered
multi choice validate attributes
Check the attributes section of <http://www.mathworks.com/help/matlab/ref/validateattributes.html> and look at 'vector' Row ...

12 years ago | 0

| accepted

Answered
Why is my loop ending after one month of data?
Eliza - on each iteration of the outer loop (for the year), the Seattle wind speed array is re-initialized as sttlwndsp = ze...

12 years ago | 1

Answered
Fix the limits of Yaxis secondary axis
Try setting the y-axis limits of the axes before changing the labels. Just change set(gca,'YTickLabel',[-25 -20 -15 -10 -5 ...

12 years ago | 1

| accepted

Answered
Storing classes as appdata and modifying them
This behaviour probably has to do with the fact that the *SampleClass* is derived from *dynamicprops* which is itself derived fr...

12 years ago | 1

| accepted

Answered
Extract identical values from a data set
The error _Error using == Matrix dimensions must agree_ is raised because *u(n>1)* contains a subset of the elements of *R* and ...

12 years ago | 1

| accepted

Answered
if statement of type cell problem..
Check out the condition in the second block of code if D{1}==1 At each iteration, the code is comparing the first element...

12 years ago | 0

| accepted

Answered
how to change the Gui close function whithout changing the close function of figures ?
Mathieu - my understanding of the *DefaultFigureCloseRequestFcn* is that once set at the root level (0), then _MATLAB uses this ...

12 years ago | 1

| accepted

Answered
complex equation with summation
Sam - have you tried executing this equation to see what it will produce, comparing the results against some known input-output ...

12 years ago | 0

Answered
how to identify a 3d matrix?
Try *ndims* which returns the number of dimensions if ndims(MAT)==3 % matrix is three dimensional end

12 years ago | 5

Answered
Intersection of voronoi edges and a rectangle
Sean - here is one way to calculate the intersection between the Voronoi edges (generated in the second figure) and the rectangl...

12 years ago | 0

| accepted

Answered
Subplots in a for loop- find the mistake
I don't think that the *hold off* is the problem, and it can probably be removed due to the *hold on* that follows. The outer...

12 years ago | 0

| accepted

Answered
How to construct an array with varying dimension?
A cell array would work well for this problem. Since you have a *for* loop, you have an idea of how many matrices you will need...

12 years ago | 1

Solved


Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

12 years ago

Solved


Is my wife right? Now with even more wrong husband
Again, as in "Is my wife right?" ( <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right> ), answer 'yes' r...

12 years ago

Solved


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

12 years ago

Solved


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

12 years ago

Answered
Generating an array from binary data
For every 8 bytes of data that the code reads in, 16 bytes are then skipped. As Carl has already answered, this is intentional ...

12 years ago | 1

| accepted

Answered
using ismember to select row
You can try the following A = [0 1 2 3 6 9 10] B = [0 1 3;3 6 9;0 3 8; 5 4 9] B(arrayfun(@(x)all(ismember(B(x,:),A)),1:s...

12 years ago | 0

Solved


radius of a spherical planet
you just measured its surface area, that is the input.

12 years ago

Solved


Circle area using pi
Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

12 years ago

Solved


Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

12 years ago

Solved


Pascal's Triangle
Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...

12 years ago

Solved


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

12 years ago

Solved


Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

12 years ago

Solved


Too mean-spirited
Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

12 years ago

Solved


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

12 years ago

Solved


Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

12 years ago

Load more