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

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 2

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 2

| akzeptiert

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

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 1

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

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

fast 14 Jahre vor | 2

| akzeptiert

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Gelöst


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

fast 14 Jahre vor

Mehr laden