Answered
Simulink modeling solution needed
Use the "Discrete-Time Integrator" block from library Simulink>Discrete. It has an option to allow external reset. Use the "Co...

15 years ago | 0

| accepted

Answered
Can't run simulink with inport
Assume both time and P are column vector, you need to put it as [time,P]. The time stamp is always the first column. The second ...

15 years ago | 0

| accepted

Answered
reading adding array of same size
If it is year per file, you can do: ch4=data(:,3); YearData=Year*ones(size(ch4)); %Year is whatever info you can get ...

15 years ago | 1

| accepted

Answered
Combining two figures in MATLAB
You may just have a typo. You want to copy H, right? What is L in the copyobj() line? Also, what is h in the last line?

15 years ago | 0

| accepted

Answered
finding columns and rows with largest sum of squares
Some hints: A=magic(3) B=A.^2 C=sum(B) [Cmax,IndC]=max(C) D=sum(B,2) [Dmax,IndD]=max(D)

15 years ago | 0

Answered
GUI - axes visibility
It looks like that when you show an image on the axes, the axes is automatically set to be invisible. You will need to find the ...

15 years ago | 0

Answered
how to make figure annotation movable by mouse (or "interactive")
Yes, you can. You just need to run plotedit(Figure) to enable it. When you do the manual insertion, it probably enables the edit...

15 years ago | 0

Answered
How get state-space model from simulink model
>> linmod('power_PSS') SimPowerSystems processing circuit #1 of power_PSS ... Computing state-space representation o...

15 years ago | 2

| accepted

Answered
Printing Colon Values in a Vector
It is a matter of an offset, right? Original: for x= 23:78 y(x) = x end Can be done as: for x= 23:78 y(...

15 years ago | 0

| accepted

Answered
Need Help with For Loops
At the beginning of the for-loop, you add an incremental of 4 right away. That is not right. I suggest you set up your if-els...

15 years ago | 1

Answered
Need help using a loop to find maximum
You are close. What you need is a while-loop. I've modified your code to make it work for this particular example data. It still...

15 years ago | 0

| accepted

Answered
How to skip data point by plotting in 2D-curves surf-curve?
x = 0:pi/100:2*pi; y = sin(x); M=numel(x); n=7; index=1:n:M plot(x(index),y(index));

15 years ago | 0

| accepted

Answered
SIMULINK - Solving Differential Equations
Since you didn't provide an explicit example, it's hard to say. Maybe this post will give you a little bit of ideas. <http://...

15 years ago | 0

Answered
Execute .m file using GUI
Is your .m file a function or a script? You need to understand the difference. <http://www.mathworks.com/help/techdoc/matlab_pro...

15 years ago | 0

| accepted

Answered
error in using this code in GUI
Your variable 'data_to_be_exported' is probably in MATLAB 'base' workspace. Your above code 'modified_data=cell2mat(data_to_be_e...

15 years ago | 0

Answered
Converting between cell & matrix
Check the contents of your variable tbl. It shouldn't be any problem if none of its cell contains matrix or cells. use celldisp...

15 years ago | 0

| accepted

Answered
Problems with importing Excel csv format
The message "some format is not compatible with csv.." indicates that the file contains some formatting that is not supported by...

15 years ago | 0

Answered
Convert a matrix in the workspace into Excel in GUI
You just need to run xlswrite. For example, xlswrite('test.xls',rand(3,4)) Inside your push button callback, you might ne...

15 years ago | 0

| accepted

Answered
Random pulse generator
Go to Simulink Sources library, there is the Random Number block and the Uniform Random Number block. The output of the Unifor...

15 years ago | 1

Answered
How to solve ODE with Simulink?
Your equation can be written as dv/dt=a*v*v+b. Drag an Integrator block, the input is dv/dt, the output is v, use Constant bl...

15 years ago | 0

Answered
How do I make my GUI plot inside of a new figure in MATLAB rather than into an axes within the GUI figure?
In your code, before running the plot, create a new figure, like f=figure; plot(magic(10)); saveas(f,...);

15 years ago | 0

| accepted

Answered
how to get handle of an image opened in the GUI figure window, to be used in other callbacks.
You must have an axes in your GUI. Let's say its tag is a. If you have an image shown in the axes, you can do this: h=findo...

15 years ago | 1

Answered
How do I plot a selective range of x-axis values
t=0:1800; mass=t; index=1:600; figure(1);plot(t(index)/60,mass(index)); index=601:1201; figure(2);plot(t(index...

15 years ago | 0

Answered
Is there a way to compare just the time portion within a serial date number using IF statements?
Yes, I think that's the purpose of having datenum. You don't need to know the encoding at all. %% StartTime=datenum(201...

15 years ago | 0

Answered
Error while calling a function
Your dtmfmain.m is not a function. It's a M-script. You can't pass an input argument to a M-script. See <http://www.mathworks.c...

15 years ago | 0

Answered
When I execute my code it keeps giving me the message "Index exceeds matrix dimensions." What should I do?
The problem happened in plot(C(1,1:T-1)). C is a 51x51 array. The value of T is 3000 so you can't do C(1,1:T-1). >> a=zeros(3...

15 years ago | 1

Answered
Using accumarray to create histograms from random integers
Check to see if you have these function. randi() hist()

15 years ago | 0

| accepted

Answered
Can Publish Format Command Line Outputs?
You can set the fonts for desktop through menu File>Preferences... But that will apply to all the Command Window output, it c...

15 years ago | 0

Answered
How to use ouput of a function as input of second function
Well, if you have those two functions defined, you can use: dtmf=dtmfseg(x); ss=dtmfscor(dtmf,freq,L,fs); or one line...

15 years ago | 1

Answered
Help in construct pulse on Signal Builder
Start with a Square signal and then you can drag and drop any part of the signal lines to make whatever you want.

15 years ago | 0

| accepted

Load more