Top 5% contributor
This package provides units conversion factors and enforces unit algebra for Matlab
3 years ago
You need to transpose e:
alternatively, create your d vector in the s...
Answered 3 years ago
This looks like it will do what you want:
index=[0 0 0 1 0 0 0 0 0 0];
i = 1;
while i < length(index)
I think you want to use events then. try something like this: function main % example to count zeros using events options = ode...
4 years ago
you can use the interp1 function to make a function out of data. here is a little example: function main a = 1; [X,Y] = ode45(...
You can use heaviside functions like this: f = @(t) (heaviside(t) - heaviside(t- 0.5))*2.*t + (heaviside(t - 0.5) - heaviside(t...
3 years ago
Hi, I have developed a class that extends the double class and adds units to it. The class keeps track of the units and prevent...
4 years ago
I am working with a class I developed, and I have this problem. I had to overload subsref because my class extends double. howev...
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN.
Remove the nth column from input matrix A and return the resulting matrix in output B.
A = [1 2 3; 4 5 6];
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...
Given the input n, return true if n is odd or false if n is even.
Find the sum of all the numbers of the input vector x.
Input x = [1 2 3 5]
Output y is 11
Input x ...
Triangle numbers are the sums of successive integers. So 6 is a triangle number because
6 = 1 + 2 + 3
which can be displa...
In MATLAB, you create a vector by enclosing the elements in square brackets like so:
x = [1 2 3 4]
Commas are optional, s...
Given a and b, return the sum a+b in c.
Try out this test problem first.
Given the variable x as your input, multiply it by two and put the result in y.
I would like to overload the ode15s function in a class definition of units. Basically I want to 1. pass arguments with units ...
How about: M2 = zeros(size(M)); M2(:) = -inf; M2([2 4],2) = M([2 4],2); [val ind] = max(M([2 4],2));
Join the conversation