I know AND doesn't work as an array formula.
But does anyone know how could I make something like this with out the AND?
=ArrayFormula(AND(M2:M="CAD data",AG2:AG<>""))
use multiplication:
=ARRAYFORMULA((M2:M="CAD data")*(AG2:AG<>""))
Related
I have two 1D arrays that gives an array of points on the XY plane. What I am trying to achieve is to find that steps interpolation for which values is exactly 0.5. I've tried to solve it using Interpolate 1D array and Threshold 1D array but no success. The first only returns values information for which steps == 0.5 and the latter is not doing anything apparently, returning 0 always.
I've attached the front panel and block diagram to the post. On the front panel I indicated which information I need.
Could you please help me figure out what I am doing wrong here? Because I'm quite stuck with this. Thank you in advance.
Kudos for solving it yourself, but a vi post of the solution would be appreciated for further reference by other people. Here is a solution that uses the 1D interpolation from the mathematics section. One VI, only downside is that you need to convert you interpolation value to an array and the answer back.
I managed to solve it. Threshold 1D array vi cannot deal with arrays that contain decreasing values... a rather frustrating error, as I need to transform the array so that the characteristics become increasing to obtain the interpolated value.
From the documentation:
Note Use this function only with arrays sorted in non-descending
order.
I'm fairly new to MATLAB and I need some help with this problem.
the problem is to write a function that creates an (n-n) square matrix of zeros with ones on the reverse diagonal
I tried this code:
function s=reverse_diag(n)
s=zeros(n);
i=1;j=n;
while i<=n && j>=1
s(i,j)=1;
i=i+1;
j=j-1;
end
but I want another way for solving it without using loops or diag and eye commands.
Thanks in advance
The easiest and most obvious way to achieve this without loops would be to use
s=fliplr(eye(n))
since you stated that you don't want to use eye (for whatever reason), you could also work with sub2ind-command. It would look like this:
s=zeros(n);
s(sub2ind(size(s),1:size(s,1),size(s,2):-1:1))=1
I have an array of structures in MATLAB and I want to plot all of the values for one key. I know you can print it by doing array.key but for some reason hist(array.key) doesn't work.
Seems simple enough but I couldn't find how to do this.
clear all
array(10).key = 1:10;
mat = [array.key]
hist(mat)
Try something like the above.
The question is quite simple but I can't find the answer.
I'm using j2me.
I have an integer array of 9 elements.
After all the computations now I want to print it or show it in a form.
It is something like Integer.toString(); for use with an array?
I know I can use a loop but I want to know if it's a faster way.
Use a loop but don't use the String + operator. Use StringBuffer.append().
In a simple way, i have an array of 10 values for example..and i would like to multiply each value with 5. Can i actually just do the following?
for (i = 0 ; i <10 ; i++)
{
x[i]=x[i]*5;
}
And what about getting square for values in the array and be stored back into the same array? As in I want x[i]=x[i]*x[i].
Can I actually just do the multiplication like that?
I tried a couple of combination but it didnt really work..hope someone can help out! Thanks!
This is perfectly fine.
edited now that the language has been specified
Yes, this "just works" in C.
Can you post more about the errors you're seeing so that we can try to help you out?