A résolu


Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

plus de 13 ans il y a

A résolu


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

plus de 13 ans il y a

A résolu


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

plus de 13 ans il y a

A résolu


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

Réponse apportée
Binary to decimal & Decimal to Binary Help
*ADD* Here is a function that might return what you wanted. It involves manipulation of the ieee74 binary representation of a do...

plus de 13 ans il y a | 0

A résolu


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

plus de 13 ans il y a

A résolu


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

plus de 13 ans il y a

A résolu


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

plus de 13 ans il y a

Réponse apportée
How to pass string to matlab function in C programs
An mxArray can also contain a string. An mxArray is a structure that wraps everything (nicely?): <http://www.mathworks.se/hel...

plus de 13 ans il y a | 0

Réponse apportée
Have trouble to solve the equation and plot
You realize that no matter the value of U (well, except in the cases where _2*x-U=0_), the solution of your equation will always...

plus de 13 ans il y a | 0

Réponse apportée
I want to read a text file having strings and numeric data. Is there any better function than textscan?
This could work: fid = fopen('bla.txt','r'); %Advance five lines: linesToSkip = 5; for ii = 1:linesToSkip-1 ...

plus de 13 ans il y a | 2

Réponse apportée
Collect conditional matrices from a loop in a 2D or cell array
Sounds like you need a cell array B =[... 7.797562562, -0.832787948, -1.725054903;... 2.11093262, 3.1385...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Using ' findobj ' command and then determining the figure objects from the list of handles
Try plot(rand(10,1)); obj_h = findobj(); get(obj_h,'Type') It will give you an idea of the hierarchy. You have the...

plus de 13 ans il y a | 1

Réponse apportée
Display long statements on multiple lines in output
One way to go. Insert newline in your string, and display using fprintf: yourString = 'One line \n Two line \n Three line';...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
how to find the position of a given number
your_answer = strfind(num2str(1050),num2str(5));

plus de 13 ans il y a | 1

Réponse apportée
how to find the number of 1 in a single column?
your_answer = sum(your_input)

plus de 13 ans il y a | 0

Réponse apportée
calling matlab from fortran program
Yes, it is possible. <http://www.mathworks.se/help/techdoc/apiref/bqoqnz0.html> I guess, the functions you want to look at...

plus de 13 ans il y a | 0

Réponse apportée
How to pad zeros?
If you want to add a dark edge (that's what the zeros will be), at the bottom and to the right: load mandrill [m n] = si...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
why 'blsprice' is an undefined function??
Use the _ver_ command to see what toolboxes you have installed. If the financial toolbox is not there, that would explain your p...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
White Square Appearance in Plot
Google is your friend: <http://www.peteryu.ca/tutorials/matlab/plot_over_image_background>

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
how to break an image into sub images
Google, as well as Matlab answers are your friends: <http://stackoverflow.com/questions/1637000/how-to-divide-an-image-into-b...

plus de 13 ans il y a | 0

Réponse apportée
Removing rows and columns of a matrix based on elements of another matrix
I think you are looking for the [] operator: B(A(1,3),:) = []; B(:,A(2,3))= []; You should not do it one after the ot...

plus de 13 ans il y a | 0

Réponse apportée
Convhull formula derivaiton in dotnet
Well, I'm going to be an heretic, but if you are going to use dotnet, maybe it is a better idea to directly use a windows execut...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
switching between 2 values
Maybe a sine wave plus some noise would do the trick? numSteps = 1000; temp = 20.5 + 3.*sin([1:numSteps]') + 3*randn(num...

plus de 13 ans il y a | 0

Réponse apportée
Pointer to MATLAB function?
I am not entirely sure this is what you mean but here goes: if (first_selection) fun1 = @(x) cos(x).^2; end if...

plus de 13 ans il y a | 1

Réponse apportée
Graph bar with plot
Look at the documentation doc bar For example: bar(m,'g','EdgeColor','k','BarWidth',0.9)

plus de 13 ans il y a | 0

Réponse apportée
Determining how many "peaks" in a graph
<http://www.mathworks.com/matlabcentral/fileexchange/4242>

plus de 13 ans il y a | 0

Réponse apportée
How to make a matrix of matrices in Matlab? (to be used to solve a system of linear equations)
Yes, you can, you need to use the curly braces: test = cell(2,1); test(1) = {rand(10)}; test(2) = {rand(10,1)}; li...

plus de 13 ans il y a | 0

Réponse apportée
3D matrix representation problem
conn = zeros(3,3,3); conn(2,2,:) = 1; conn(:,2,2) = 1; conn(2,:,2) = 1; CC = bwconncomp(U3,conn); Note that the...

plus de 13 ans il y a | 0

Charger plus