Gelöst


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

etwa 14 Jahre vor

Gelöst


Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Example...

etwa 14 Jahre vor

Gelöst


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...

etwa 14 Jahre vor

Gelöst


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 ...

etwa 14 Jahre vor

Gelöst


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...

etwa 14 Jahre vor

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

mehr als 14 Jahre vor | 1

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

mehr als 14 Jahre vor | 0

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

mehr als 14 Jahre vor | 0

| akzeptiert

Beantwortet
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]....

mehr als 14 Jahre vor | 2

Beantwortet
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...

mehr als 14 Jahre vor | 0

Beantwortet
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...

mehr als 14 Jahre vor | 0

Beantwortet
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...

mehr als 14 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 14 Jahre vor | 0

Beantwortet
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...

mehr als 14 Jahre vor | 0

Beantwortet
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 ...

mehr als 14 Jahre vor | 0

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

mehr als 14 Jahre vor | 0

Beantwortet
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...

mehr als 14 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 14 Jahre vor | 0

Beantwortet
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...

mehr als 14 Jahre vor | 0

Beantwortet
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...

mehr als 14 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 14 Jahre vor | 0

Beantwortet
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 ...

mehr als 14 Jahre vor | 0

| akzeptiert

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

mehr als 14 Jahre vor | 1

| akzeptiert

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

mehr als 14 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 14 Jahre vor | 0

| akzeptiert

Beantwortet
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))

mehr als 14 Jahre vor | 1

| akzeptiert

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

mehr als 14 Jahre vor | 0

Beantwortet
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 ...

mehr als 14 Jahre vor | 0

Beantwortet
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...

mehr als 14 Jahre vor | 0

Beantwortet
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(''...

mehr als 14 Jahre vor | 0

Mehr laden