Solved


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

13 years ago

Solved


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

13 years ago

Solved


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

13 years ago

Solved


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

13 years ago

Solved


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

13 years ago

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

13 years ago | 0

Solved


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

13 years ago

Solved


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

13 years ago

Solved


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

13 years ago

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

13 years ago | 0

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

13 years ago | 0

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

13 years ago | 2

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

13 years ago | 0

| accepted

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

13 years ago | 1

Answered
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';...

13 years ago | 0

| accepted

Answered
how to find the position of a given number
your_answer = strfind(num2str(1050),num2str(5));

13 years ago | 1

Answered
how to find the number of 1 in a single column?
your_answer = sum(your_input)

13 years ago | 0

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

13 years ago | 0

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

13 years ago | 0

| accepted

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

13 years ago | 0

| accepted

Answered
White Square Appearance in Plot
Google is your friend: <http://www.peteryu.ca/tutorials/matlab/plot_over_image_background>

13 years ago | 0

| accepted

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

13 years ago | 0

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

13 years ago | 0

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

13 years ago | 0

| accepted

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

13 years ago | 0

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

13 years ago | 1

Answered
Graph bar with plot
Look at the documentation doc bar For example: bar(m,'g','EdgeColor','k','BarWidth',0.9)

13 years ago | 0

Answered
Determining how many "peaks" in a graph
<http://www.mathworks.com/matlabcentral/fileexchange/4242>

13 years ago | 0

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

13 years ago | 0

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

13 years ago | 0

Load more