Answered
Out of memory problem
You have several options: Use sparse matrices : a = sparse(eye(400)); your_mat = sparse(kron(a,rand(57,5)); The ...

13 years ago | 0

Answered
Set the Subplot Apsect Ratio Manually
That would depend on the aspect ratio of your figure box, for instance: h = figure; pos = get(h,'Position'); ratio = ...

13 years ago | 0

| accepted

Answered
Subplot without stretching images?
You can create custom axes, e.g.: ax(1) = axes('Position',[0.05 0.1 0.3 0.8]); ax(2) = axes('Position',[0.35 0.1 0.3 0.8...

13 years ago | 0

Answered
NaN (Not a Number) problem in integration
No, it should not give you pi/2. The way you have set up your matrices, the expression h+((sin(x).^2).*I)))*mz will alw...

13 years ago | 0

| accepted

Answered
Linear plot to contour plot
I don't think a polar plot would do the trick, you could use patches: data_length = 10; %The values you want to plot: ...

13 years ago | 0

Answered
How to create a bidimensional matrix containing the maximum values from a tridimensional one?
your_median = median(G,3); your_max = max(G,3); Such functions allow you to accumulate along a specified dimension (the ...

13 years ago | 0

| accepted

Answered
How to find last and first column of matrix which is not NaN?
Index to first column: idx_first = find(sum(~isnan(your_data),1) > 0, 1 ,'first') Index to the last column: idx_l...

13 years ago | 2

Answered
How to import a spesific variable from a matrix in a file?
filename = 'SANJOSE'; (SANJOSE is a text file containing one line: _20 30_) Two options, either pass the file name SANJ...

13 years ago | 0

| accepted

Answered
Functional form of the colon (:) operator?
function y = myfunc(a,b) //make sure that vectors are oriented the same way y = reshape(a(2:end),[],1) .* reshape(b(2:en...

13 years ago | 2

| accepted

Answered
create envelope from multiple qqplot curves
This will work if both datasets ( _x1_ and _y1_) have the same length: data = rand(10,2); x1 = data(:,1); y1 = data(:...

13 years ago | 0

Answered
How can I count patterns in matrices
There is a built in function for that, that allows you to specify a connectivity pattern: _doc bwconncomp_

13 years ago | 0

Answered
How to avoid to plot the NAN value?
Assuming all dimensions match: XX_t = DV_XX(1:4:end); XX_t(3:3:end) = NaN; YY_t =DV_YY(1:4:end); YY_t(2:3:end) = N...

13 years ago | 0

| accepted

Answered
find values from a matrix according to a criterion
time = [733774,733774,733775,733775,733775,733776,733776]; data = [1,1.3,1,2.5,2.5,1,1.2]; unik_time = unique(time);...

13 years ago | 0

| accepted

Answered
how can I access the index of one class? details are given below
classnumber = floor((your_number-1)/20) + 1; inclass = mod(your_number-1,20) + 1;

13 years ago | 0

| accepted

Answered
Averaging matrices over time (in for loop)
Maybe this could work (counter is not strictly necessary): counter = 0; numSteps = 100; your_average = zeros(50); ...

13 years ago | 0

| accepted

Answered
Finding coefficients of quadratic equation without Symbolic Toolbox.
You don't really need the symbolic toolbox for that. For instance, one of the solutions will always be _a = y/x, b = -1_ and _c ...

13 years ago | 0

Answered
change axis range but not the graph in 3d plot
Is it not just a matter of setting the axes limits to [0 200]? GG2 =rand(109,512); figure43 = figure(43); h = surf(GG...

13 years ago | 1

Solved


Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

13 years ago

Solved


Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

13 years ago

Solved


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

13 years ago

Solved


Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

13 years ago

Solved


Remove the vowels
Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

13 years ago

Solved


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

13 years ago

Solved


Sums with Excluded Digits
Add all the integers from 1 to n in which the digit m does not appear. m will always be a single digit integer from 0 to 9. no...

13 years ago

Solved


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

13 years ago

Solved


Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

13 years ago

Answered
Including mat.h and using in a C++ program
mat. h is a header file, not a library. You need to tell your compiler where it's located. You could probably get that info from...

13 years ago | 2

| accepted

Solved


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

13 years ago

Solved


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

13 years ago

Solved


Most nonzero elements in row
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...

13 years ago

Load more