Beantwortet
How the find the Intersection Points?
You should be aware that your equations are the mathematical equivalent of the geometrical problem of finding the intersections ...

mehr als 11 Jahre vor | 0

Beantwortet
Speeding up Binary Matricies Generation with given conditions
There is a flaw in the strategy of your code. If at the step m = randi([0 1],rows,columns); it does not yield exactly ...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
Looping with unequal increment
x = [5,15,25,30,45,60,65,70,75,90]; for i = 1:length(x) % Get parameter values from x(i) and store them at i-th arr...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
Generating random complex numbers between -0.5 to 0.5 in Gatbx
(rand(20,2)-.5) + (rand(20,2)-.5)*1i ;

mehr als 11 Jahre vor | 0

Beantwortet
I got an errow while plotting 3D surface
If I understand you correctly, the matlab 'surf' function is not the right one for your problem, since it would require that you...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
How to find common numbers in 4 matrices
Apparently from your statement, "find common numbers in 4 matrices", you should be using matlab's 'intersect' function, not 'ism...

mehr als 11 Jahre vor | 0

Beantwortet
Why are these sums not the same?
There is no reason they should be the same! In the for-loop method you are not doing a summation, as is done in the first metho...

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
Hi I want to plot t with respect to Vcf in my code , but only obtaining the max plot value only
You need to do a "hold on" to combine all the plotted points. Otherwise after each step of the while loop the previous plot get...

mehr als 11 Jahre vor | 0

Beantwortet
Checking for Pythagoric Triplets
Since there are infinitely many real-valued "Pythagoric" triplets between two given limits, 'k' and 'n', I will guess that you a...

mehr als 11 Jahre vor | 0

Beantwortet
Generating empty interval of points
Do this: LB=20;UB=80; x = LB+(UB-LB)*rand(50,1); y = LB+(UB-LB)*rand(50,1); t = ((x<=40)|(x>=60)) & ((y<=40)|(...

mehr als 11 Jahre vor | 0

Beantwortet
Azimut angles comparison for wind (position differences in a vector)
Presumably you want a difference that lies between 0 and 180, as would be true for the inner angle of any triangle. a = mo...

mehr als 11 Jahre vor | 0

Beantwortet
How can I write such a large matrix?
b = zeros(2^20,20); for k = 1:20 b(:,k) = repmat([zeros(2^(k-1),1);ones(2^(k-1),1)],2^(20-k),1); end

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
How to get minimum element of matrix and corresponding row elements
N = sqrt(sum(A.^2,2)); % I assume you mean the L2 norm [Nmin,ix] = min(N); Amin = A(ix,:); where Nmin is the minim...

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
creating a random vector of the values 0,1 with specific gaps
There are two possible meanings you might have for the phrase _"20% of the values are 1"_ : 1) The percentage of ones has a ...

mehr als 11 Jahre vor | 0

Beantwortet
getting a vector with random numbers but with new criteria
You want n random integers, each ranging from k to z, such that each differs from the two previous integers. Call the vector of...

mehr als 11 Jahre vor | 1

Beantwortet
How to make my logical data homogene?
data(diff([1,data,1],2)==2) = 1;

mehr als 11 Jahre vor | 0

Beantwortet
How to find the second interesection between two plots?
There is no reason to believe that the best-fitting straight lines to the two entire curves will intersect at the same points as...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
Transforming matrices in a sophisticated way
If a1, a2, a3, ..., an are each p-by-q in size allC = reshape(permute(reshape(allR,p,q,n),[1,3,2]),p*n,q); allR = resh...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
Defining anonymous function using an "if" statement
Try this: f = @(x) (x.^2>=x).*x.^2+(x.^2<x).*x

mehr als 11 Jahre vor | 4

Beantwortet
Solving Symbolic matrix with different variables
Use matlab's 'solve' function.

mehr als 11 Jahre vor | 1

Beantwortet
how do i isolate the elements above both main triangles of a square matrix?
Try this: % Create some arbitrary square matrix, M n = 12; M = magic(n); % Erase all but your "upper triangl...

mehr als 11 Jahre vor | 0

Beantwortet
, I need help! I do not get to have the graph of the solution of a differential equation.
I am guessing that you left out the parentheses in the denominator of F, which would presumably be this instead: F=@(x,s)(...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
function in the matlab
If Q is a vector, I would suggest the following: W = zeros(size(Q)); W(1) = Q(1); for k = 2:length(Q) W(k) =...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
How to extend a array by multiplying internal values e.g. [1 2 3 4] to [1 1 1 2 2 2 3 3 3 4 4 4]?
B = A(ceil((1:4*size(A,2))/4)); % <--- Corrected

mehr als 11 Jahre vor | 3

Beantwortet
find area of triangle with 3 points known
If I interpret the figure correctly, the area is: a = 1/2*(xmax-xmin)*ymax; In general a triangle's area is one-half it...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
what's the error in this code ? it should return the position of the minimum electric field but it return zeros ,whyyyyy T~T
Instead of computing the total electric field for all charges at each separate point, you appear to be summing the field compone...

mehr als 11 Jahre vor | 0

Beantwortet
How to use end result for the next iteration
In my opinion, there is a lot of wasted computation in your code, Zahid. For example, the inequality p(j)<d(j) is equivalent to...

mehr als 11 Jahre vor | 0

Beantwortet
matrix operaions sums multiplications
C = A(:,1:2)*B.';

mehr als 11 Jahre vor | 3

Beantwortet
Problem of Substraction operation on MATLAB R2014a
Just because the two quantities both displayed 912.7400 does not mean that the quantities they represent in the computer are act...

mehr als 11 Jahre vor | 0

Beantwortet
Multidimensional Array Conversion way
A = reshape(permute(A,[1,3,2]),[],1e5);

mehr als 11 Jahre vor | 1

| akzeptiert

Mehr laden