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

circa 14 anni fa | 0

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

circa 14 anni fa | 0

| accettato

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

circa 14 anni fa | 0

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

circa 14 anni fa | 0

| accettato

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

circa 14 anni fa | 0

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

circa 14 anni fa | 0

| accettato

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

circa 14 anni fa | 2

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

circa 14 anni fa | 0

| accettato

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

circa 14 anni fa | 2

| accettato

Risposto
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(:...

circa 14 anni fa | 0

Risposto
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_

circa 14 anni fa | 0

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

circa 14 anni fa | 0

| accettato

Risposto
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);...

circa 14 anni fa | 0

| accettato

Risposto
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;

circa 14 anni fa | 0

| accettato

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

circa 14 anni fa | 0

| accettato

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

circa 14 anni fa | 0

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

circa 14 anni fa | 1

Risolto


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

circa 14 anni fa

Risolto


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

circa 14 anni fa

Risolto


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

circa 14 anni fa

Risolto


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

circa 14 anni fa

Risolto


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

circa 14 anni fa

Risolto


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

circa 14 anni fa

Risolto


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

circa 14 anni fa

Risolto


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

circa 14 anni fa

Risolto


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

circa 14 anni fa

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

circa 14 anni fa | 2

| accettato

Risolto


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

circa 14 anni fa

Risolto


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

circa 14 anni fa

Risolto


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

circa 14 anni fa

Carica altro