Solved


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

14 years ago

Solved


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

14 years ago

Solved


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

14 years ago

Answered
Create a monthly date vector of serial numbers
%% x=bsxfun(@(Month,Year) datenum(Year,Month,1),(1:12).',1980:2010); x=x(:); diff(x)

14 years ago | 1

Answered
Can the "menu" user dialog have multiple outputs?
use listdlg() and set the 'SelectionMode' as 'multiple'

14 years ago | 0

Answered
Webinar - PDF?
All the information are <http://www.mathworks.com/matlabcentral/fileexchange/29489 here>.

14 years ago | 0

| accepted

Answered
Matlab matrix
Along the line of this code, depending on your data format. ID={'ID1','ID2','ID3','ID5','ID6'}.'; Col2=[54 45 23 32 75 87]....

14 years ago | 2

Answered
How to avoid algebraic loop problem
It depends. But you can start from here. <http://www.mathworks.com/help/toolbox/simulink/ug/f7-8243.html#f7-19688 Algebraic Loop...

14 years ago | 0

Answered
how to record and use the history of a variable in simulink
I don't know if you can change the number of previous steps dynamically. If the number is not large, you can always record the m...

14 years ago | 0

Answered
activex PowerPoint Application Saving as ".ppt" default, not ".pptx" ?
try invoke(op,'SaveAs',filespec,11); 11 is ppSaveAsDefault. Go to PowerPoint help, Visual Basic Reference, Enumerations, PpSaveA...

14 years ago | 0

| accepted

Answered
Mask dialog box too small, adds verticle scrollbars
Look at maskedit.m, the function CreateMaskEditor() decides the size of the dialog based on the screen size. Maybe you can modif...

14 years ago | 0

Answered
adding "Rate_Transition" block via Add_Block() error
Use add_block('built-in/RateTransition', ...) without the white space. This could be improved on the TMW side. If you look at d...

14 years ago | 0

Answered
lsim with nonzero initial condition
You can't use lsim(A,B,C,D,...). You need to use Sys=ss(A,B,C,D); y=lsim(Sys,u,t,X0); *UPDATE*: You can't arbitrarily set ...

14 years ago | 0

Answered
3d plotting of experimental data
try surf(YourMatrix) mesh(YourMatrix)

14 years ago | 0

Answered
Slice matrix upon "group ID" to get the mean
%% x = [1,2,3,4,5,6,7,8,9,10]; % Data y = [1,1,1,2,2,1,2,1,1,5]; % Vector containing the group id [GroupId,indx_i,i...

14 years ago | 1

| accepted

Answered
Getting a higher resolution bode plot
You can specify the frequency vector for the bode plot. But more seriously, you are not using feedback() and bode() correctly. Y...

14 years ago | 0

Answered
Median() ignoring zeros
You probably need to do a for-loop. %% Col=size(A,2); B=zeros(1,Col); for k=1:Col B(k)=median(A(A(:,k)~=0,k...

14 years ago | 0

Answered
PWM and Subusystem problems
By default, the Scope has a limit of 5000 data points. Double click the Scope block, click the second icon on the top for "Param...

14 years ago | 0

| accepted

Answered
Reordering columns in a matrix
If you have to do this, you can use subsref() %% a=magic(3) b=subsref(a,substruct('()', {':',[2,1,3]})) In your case, it...

14 years ago | 0

Answered
Problems with multiplications (matrix dimensions must agree) on F5, but not on F9
Your variable 'probabilidadeDeExtincao' is an input argument to the function, while it is also a global variable. This could be ...

14 years ago | 0

| accepted

Answered
Just a small problem
function y=MyRandInt while true y=floor(8999*rand+1000); if length(unique(num2str(y)))==4 return; ...

14 years ago | 1

| accepted

Answered
Fixed step size in a DC Motor Simulation
Your system is continuous. Try ode45 with variable step size first.

14 years ago | 0

| accepted

Answered
Help with Function please !
Please don't do this. Follow this thread. <http://www.mathworks.com/matlabcentral/answers/143-how-do-i-make-a-series-of-variable...

14 years ago | 0

| accepted

Answered
Computing values from a subsection of a data file
Very close. Just missed one dot. %% %z1 = data(1:10,2); z1=zeros(10,1); Rz1 = 1./(sqrt(4*z1.^2 + 1))

14 years ago | 1

| accepted

Answered
imwrite filename
R='MyImageFile'; imwrite(X.cdata,[R,'.png']);

14 years ago | 0

Answered
Simulink Model made in Matlab 6.5.1 (R13SP1) doesnot work in higher versions
Open your old version of Simulink model in the new version of Simulink software and do a save-as. Pay attention to any messages ...

14 years ago | 0

Answered
if loop not executing
if-else statement won't do any loop. I assume this is an exercise. You almost need to re-work on the code completely. "multipl...

14 years ago | 0

Answered
evalin('base', 'save('var1', 'var2')')
You need to pay attention to the syntax for using single quote inside the single quote. You could do. evalin('base', 'save(''...

14 years ago | 0

Answered
In 2007b, block paths having more than 1290 characters are not recognized.
I am not sure if such limitation exists, even in R2007a. Let's see if it is something else. I assume you want to open a subs...

14 years ago | 0

Answered
Transfer function vs. gains, differentiator, integrator = different, but I don't know why?
It must be due to the limitation of calculating du/dt. If you are using all the default setting, you'll notice some warning mess...

14 years ago | 0

| accepted

Load more