Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
I have constructed truth tables to prove that:
ABC + ABC'+ AB'C A'BC = AB+AC+BC,
but how do i prove it by simplifying the expression? I'm fairly new to boolean algebra and have tried to use the basic identities to figure it out, but can't seem to get there.
You could write:
ABC + ABC'
as
AB(C + C')
Since C + C' is always true, that's just AB. The same pattern holds for AC(B + B') and BC(A + A') being equivalent to AC and BC respectively.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I want to intertwine 0s between the bits of a variable. For example, imagine I have a variable a as follows
a = 1101
Then, I want to obtain the following result
b = 1_000000_1_000000_0_000000_1
That results from intertwining 6 0s betwen each bit of a. I was wondering if there was any elegant way of doing this in SystemVerilog. Any help is appreciated.
b = 0;
foreach (a[i]) b[i*7] = a[i];
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
For a scalar c and a nxnmatrix A, what is the meaning of c^A?
E.g.
>> c=2;
>> A=[1 2; 3 4];
>> c^A
ans =
10.4827 14.1519
21.2278 31.7106
All I could find was this section in the Mathworks documentation.
But what is the real meaning of that, is this a commonly accepted definition? Is this useful in real applications?
Any reference to a document with further details is appreciated.
(I am aware of the element-wise operation c.^A)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I have two numbers a and b such that a*a*b=constant. How can I find all as and bs which satisfies this equation?
Can I have a graph for example for a versus b?
Actually, I am looking for a relationship between a and b, as an example an equation for their graph mentioned before.
Let c be the constant, then
a*a*b=c
We find an explicit solution for b(a) by
b = c / (a^2)
Now we can easily plot b vs. a. E.g. for c=1 :
Specify which points for a you want to plot. E.g. a = -2:0.1:2
Calculate b: b = c ./ (a.^2);
Plot b vs. a: plot(a,b);
All together:
c = 1;
a = -2:0.1:2;
b = c ./ (a.^2);
plot(a,b);
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Given a matrix A and a matrix B, how do I compare them element by element so the program returns a third matrix C that shows:
- If the element in A is larger than the one in B, the element in C should be 1.
- If the element in A is smaller than in B, the element in C should be -1.
- If the elements of both matrices are equal, the element in C should be 0.
Hope you can help!
C=zeros(size(A));
C(A>B) = 1;
C(A<B) = -1;
Note that it's never a good idea to do an equality test on floating point numbers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I need to type some matrix containing both letters and numbers.
Something like list=["a" 1;" b" 2; "c" 3; "d" 4; "e" 5; "f" 6; "g" 7]
Can anybody give me some tip?
If you want "just" a mix of strings and numbers, use a cell array. See the MATLAB documentation here.
If you're trying to set up some kind of map/hash, you want a MATLAB "structure." See the documentation for that here.