MATLAB: Comparing two vectors getting results in the new one vectors Hi, I want to compare two arrays (10000×1) and get a third one with values either 1 (V1>V2) or 0 (V1<V2). Anybody could help? Thanks Best Answer c=a>bThis will return 0(for a<b) and 1(for a>b), 10000x1 logical array. Related SolutionsMATLAB: How to define an arbitrary constant for equations If you are talking about making an assumption, you can do it as follows:v1=6;v3=18;syms v2 v4 v5 v6eqn1= -v4+v5==-v3;eqn2= -v2+v6==v3;eqn3= -v5-v6==-v1;assume(v6~=0)[v2 v4 v5 v6]=solve(eqn1, eqn2, eqn3);[v2 v4 v5 v6] MATLAB: How to get the facecolor of each bar Use the handles to the bar graph to retrieve its 'FaceColor' property.Eg:hbar1 = hbar(data,SomeColor);Then you can get the color specifications with:get(hbar1,'FaceColor');and apply it to another graph: hbar2 = hbar(data2,get(hbar1,'FaceColor')); Related QuestionSet vector elements of one vector to nonzero elements of anotherAssign patterns to clustersMatch time stamps index
Best Answer