Answered
Files as Input Arguments for a Function
The char variable can be used to contain the file name string. function out=MyFunction(FileName1,FileName2,Const1,Const2)...

15 years ago | 0

Answered
Vectorize loop with function containing randoms
First, don't use max as a variable name as max() is a popular function. Second, Are you looking at: ds=rand(5,3) for example? ...

15 years ago | 0

Answered
How to display text on image
text() annotation()

15 years ago | 0

Answered
change cell dimension
for k=1:length(a) a{k}(end+1:50={[]}; %pad with [] %a{k}(end+1:50={0}; %pad with [] end

15 years ago | 2

| accepted

Answered
Passing Variables between functions in a GUI
<http://blogs.mathworks.com/videos/2005/10/03/guide-video-part-two/ How to pass data from one GUI to another in MATLAB>

15 years ago | 1

Answered
Quickly access a group of arrays using a loop
Using num2str() and eval() should be able to do it. See this post for details. But it is highly recommended not to name variable...

15 years ago | 0

| accepted

Answered
hand motion detection
I believe it was this April, Google announced Gmail Motion BETA. <http://www.google.com/mail/help/motion.html> Be discreet !

15 years ago | 0

Answered
Signal Builder Time Issue
I think this might be the issue. When you run the simulation the first time and reach the model state xFinal, you need to re...

15 years ago | 0

| accepted

Answered
add a function to be executed for a subplot ButtonDownFcn event
Nothing is wrong. You just need to move your cursor over the subplot and then press button down. It worked for me as I tried. ...

15 years ago | 0

Answered
Plot Marker - can it be alphabetical?
As far as I know, that's not available in plot() as of now. All the possible markers are those listed in help plot. Something...

15 years ago | 0

| accepted

Answered
Extracting row elements from different columns using an index
%% A=rand(18,4); B=rand(18,4); [Ma,indA]=max(A,[],2); indB=sub2ind(size(A),(1:size(A,1))',indA); Sb=B(indB)...

15 years ago | 3

| accepted

Answered
Fieldname
function fieldnames() is for structure. If the input argument is not a structure, it will cause the error. s.a=1; s.b=2; ...

15 years ago | 0

Answered
Not able to use function handles in MATLAB 2006b version.
The code runs without error if you fix: missing global definition in function Handles() duplicated function SUB_GetFuncHan...

15 years ago | 0

Answered
simulink block mask icon
<http://www.mathworks.com/help/toolbox/simulink/gui/f8-21507.html> You can find that in your local documentation too.

15 years ago | 0

Answered
Handles problem
I believe it is setappdata(handles,'boardtype',0), not setappdata(hObject,...), same for getappdata(). *EDIT: My above answer i...

15 years ago | 3

Answered
Data into matlab using figure
If you have your measured data stored in a file, such as .txt, .csv, .xls or many other format, you can use the following functi...

15 years ago | 2

Answered
Can not read in a cdf
Where did you download the patch? What version of MATLAB are you using? Can you try to run the following command to see if there...

15 years ago | 0

Answered
Sorting imported data into a structure array
I don't fully understand the structure of your struct array, but for sorting, you can reference the following example: >> [...

15 years ago | 1

Answered
Equation of a straight line, how to create an equation with two matrices?
Are you trying to draw a line from (10,1) to (0,10)? line([10,0],[1 10]) Or you mean this: %% x=zeros(2,10); y=zeros(...

15 years ago | 0

| accepted

Answered
x 10^5 appears in x-axis with datetick
Will Kelly's answer in this post apply to you? <http://www.mathworks.com/matlabcentral/answers/12882-remove-common-factor-fro...

15 years ago | 0

| accepted

Answered
Timer Implementation In Simulink
It might be easier if done in MATLAB. You want the result in MATLAB base workspace anyway. a is your input pulse, Out is the res...

15 years ago | 2

| accepted

Answered
vector subtraction
bsxfun()

15 years ago | 0

Answered
What does +(A>0) do?
The "+" doesn't mean anything here. Probably somebody with C++ experience wrote it. You can try this example: A=rand(3)-0.5...

15 years ago | 0

Answered
Unrecognised handles in set
"This only happens when I run the program without debugging it." Did you double click the .fig file in Windows Explorer to run i...

15 years ago | 0

Answered
Data indexing
I guess I found another use of an old trick. Check the value of the string "Cmd" after running the following three lines of code...

15 years ago | 0

Answered
Importing constants for use in Simulink
There is a way that you can import the data from the Excel file and use the header string as the variable name. You can do it ma...

15 years ago | 0

| accepted

Answered
Combining Matrices
Hope it's not too late. The better approach is not to name your variable as A1, A2, A3. This problem has been asked numerous tim...

15 years ago | 0

Answered
Error using mex file in S-function
MATLAB 4.2b is too old. By looking at the year the book is published, the model probably was developed more than 15 years ago. T...

15 years ago | 0

Answered
indexing duplicates in cell arrays
%% A_ID=2; B=[61;85;88]; C={[2;44;85;88],[2;19;34;44;61;74],[2;23;61]}; Out=[]; B_2=nchoosek(B,2); for k...

15 years ago | 0

Answered
how to make all vectors to equal size for a cell array.
It might be easier using a for-loop, with hold on; figure;hold on; for k=1:length(z) plot(z{k}); end

15 years ago | 0

| accepted

Load more