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

plus de 13 ans il y a | 0

Réponse apportée
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 = ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 0

Réponse apportée
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...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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: ...

plus de 13 ans il y a | 0

Réponse apportée
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 ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 2

Réponse apportée
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...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 2

| A accepté

Réponse apportée
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(:...

plus de 13 ans il y a | 0

Réponse apportée
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_

plus de 13 ans il y a | 0

Réponse apportée
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...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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);...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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;

plus de 13 ans il y a | 0

| A accepté

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

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 13 ans il y a | 0

Réponse apportée
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...

plus de 13 ans il y a | 1

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

Réponse apportée
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...

plus de 13 ans il y a | 2

| A accepté

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

A résolu


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

plus de 13 ans il y a

Charger plus