multiplication of matrices

HI, I would ask how to perform muptiplication matrix 10 x 10 with table (do not use linear algebra)...
AxB = C (A, B, C all 10 x 10). How can I do this?  Many thanks for any help

If you remember your secondary algebra, then it should be a very easy process to treat two 2D arrays of (I was going to say 'floats', but they could be integers) numbers as if they were a matrix and simply to perform the operation.  Have loops to auto-index through the two tables and relevant table of the functions (big hint - such that transpose) make it easy to do this in a very compact way.  Of course, if you've ever learned about matrices and how to manipulate them, it will be more complicated...

Just thinking, you should be able to do it with two nested for loops, a matrix function and two digital functions.  For extra credit, you can add a Boolean test (followed by a Case statement that gives an Error Message If the test fails) to ensure that the two tables have a compatible size.

Bob Schor

Tags: NI Software

Similar Questions

  • Measurement Studio has a least-squares method to solve the multiplication of matrices?

    I'm looking for a least-squares method to solve the multiplication of a matrix of 99 x 99 to a 99 vector element.

    Is there a method similar to the "fminsearch' of Matlab function?

    This is the method I use now...

    NationalInstruments.Analysis.Math.LinearAlgebra.Multiply (InverseMatrix99x99, Vector_99)

    Thank you.

    To my knowledge there is not a feature that replicates Matlab function "fminsearch" in the analysis of Measurement Studio package nor is there a multiplication of matrix least-squares method. However, you could write a DLL and call it in your Measurement Studio project. LabVIEW has an implementation of "fminsearch" in its packaging MathScript. You can read the documentation on that here (http://zone.ni.com/reference/en-XX/help/371361D-01/lvtextmath/msfunc_fminsearch/).

    Kind regards

    Steven Zittrower

    Technical sales engineer

    National Instruments

    http://www.NI.com/support

  • Waveform to the Multiplication of matrices

    Hi all.

    I have a DAQ - MX file that brings a table 1 d of waveforms. This will be either six, seven or eight waveforms (based on the previous settings). Regardless of how many there are, I want to take the first six of these waveforms and a matrix multiplication.

    In other words, if A is my 6 x 1 read voltages in the acquisition of data, I want to multiply this matrix by B, a 6 x 6 of constants.

    Is this possible?

    Thank you

    James

    Then do what I said in message 3.

    You started confusing things when you started talking on the application to the constants to the entire waveform.  It is impossible to make a 6 x 6 times 6 x 1 matrix multiplcation if you talk about all the points in a wave form which will have more than 6 points.

    Looking at your last equation, is the vector of 6 x 1 represents a single element in time of 6 waveforms?  If so, use the first part of what I said in message 3 to convert your table 1 d of waveforms in a 2D array.  Then iterate over the column of table 2D 1 or 1 row at the time (dimension whatever gives you the unique element of 6 different channels).  You may be able to auto-indice according to the direction.  Use this table 1 d of 6 item to your multiplication of matrix with your matrix 6 x 6.

  • dosent HP 50g calculator works properly

    Hello! I am a user of the calculator hp 50g graphic and I noticed that it is not working properly... What I mean is that it multiplies bacic matrices write the message 'invalid dimension', which tries to find the det (A) = 0 matrix 6 * 6 with the variable x in its diagonal elements, he finds a degree 16 polynomial instead of a degree 6 polynomial! I am completely disappointed! What should I do?

    Thank you very much!!!
    You Allied fill solved all my problems!

  • How can I make the matrix using numbers

    Yes, for now I'll try to find out how to use the numbers to do the multiplication of matrices

    Something like that?

    In cell A1, filled to the right and downwards:

    = SUMPRODUCT (Matrix 1::1:1, TRANSPOSE (matrix 2::A)))

    SG

  • Improved speed for the LabVIEW MathScript calculation

    I use a MathScript node to perform calculations on a sbRIO FPGA module and the speed of these calculations is critical.  What are some ways to improve the speed of calculations and y at - it a faster way to make calculations of MathScript matrix?  If I belong the MathScript in a Subvi it will improve the speed of calculations?

    Thanks for any ideas

    Please look at the VI attached. She is your original code ".m", my changes to your ".m" and G code equivalent to the updated code ".m". First, let me describe the numbers that I've seen on a cRIO 9012 for each of the three approaches.

    I ran to each of the three approaches for the hundreds of iterations, ignored the first 30 iterations to allow allocations of memory (which caused a huge spike in runtime performance about the RT), then took the average operation time for each iteration of the loop for the remaining iterations

    Original M: 485 msec/iteration

    Updated M: 276 MS/iteration

    G: ms 166/iteration

    The changes I made to your code ".m" are:

    (1) added; at the end of each line to remove output (used for debugging)

    (2) left random code generation - used whitenoise (seems like that is what you did)

    (3) turn on the type of data highlighting the function. Noticed that the majority of data was cast in the complex, although that did not seem like you need the complex domain. The source has been function sqrt. Changed using real (sqrt (...))

    This improvement in performance by more than 40%. I believe that more can be pressed if you follow the documentation - MathScript wrote for real-time Applications.

    Then I took the MathScript you and equivalent written G leaving the algorithm as it is. This gave us the improvement of the performance of another 40 per cent in the G. updated the it is a known issue that on slow controllers, MathScript adds a penalty of 2 x to g equivalent. We are investigating this issue and may be able to fix it in a future release.

    If you are profiling the G code, you will notice that most of the time we spend in the multiplication of matrices. Unless rethink you your algorithm, I doubt that this can further improve.

    Let me know if you have any questions

    Kind regards

    Rishi Gosalia

  • nested loops for speed optimization

    Hello. I need help to optimize for speed (in LabVIEW) code (matlab) following:

    -----------------------------------

    a = rand(1024, 200);
    b = rand(1024, 512);
    c = Zeros (200,512);
    ICT
    for i = 1: 200
    j = 1:512
    c (i, j) = (Sum ((:,i).*b(:,j))) a ABS;
    end
    end
    Table of contents
    end

    -------------------------------------------------------------

    Basically I have two 2d tables, a and b, one with 200 columns and rows of 1024, other columns a 512 and 1024 lines. What I have to do is multiply (dot product) each column a each column of b, the sum and take the absolute value of the result. The output, c, will be an array of 2d of size 200 x 512. Is it possible to do without the help of 2 loops of nesting? The two paintings 2d, a and b\, are produced by my material.

    What is the best strategy to get the maximum speed? I have a powerful enough processor.

    Thank you very much?

    So I looked at this problem, said «seems familiar, but different...» ».  Did a little math, encoded at top and improved the speed by a factor of 100 (with absolutely no parallelism).  How about apples?

    If we let A and B tables 1024 x 512 and 1024 x 200 and turn them into matrices, the problem is (mathematically) the absolute value of the transposed from A times B, where "the times" are the multiplication of matrices.  I "guessed" that NEITHER would have included the Multiplication of matrices in his bag of tricks and maybe optimized, so I coded it upward, adding the calendar.

    Using the first double Lynn - to multiply, sum, formulation of abs and a 'do it as a matrix' on my machine, the Array 1004 msec, the matrix method took 10 msec, as well as the results differ by less than one part in 1 million (I generated at random (0, 1) floats, and made the comparison by subtracting the two tables and checking that the absolute all the differences were less than 1E-6).

    Bob Schor

  • DevMatrix conversion problems

    Hello

    Suppose I have a rectangle in userspace with left = 0, top = 10, right = 10, bottom = 0 (converted from these values ASInt32 to ASFixed).

    If I call AVPageViewRectToDevice, the rectangle of peripheral space I'll be back to the left = 0, top = 1195, right = 15, low = 1210.

    If I call AVPageViewGetPageToDevMatrix on the AVPageView even, I get the matrix [2, 0, 0, -2, 0, 1210].  This application as a transformation to the original rectangle annoys me to the left = 0, top = 1190, right = 20, low = 1210, which is disabled by 5 for the top and to the right.

    I think that's a rounding error, except that as I increase the x and y values in my original rectangle coordinates, the difference between AVPageViewRectToDevice and math matrix direct increases to about half of the x or increases there (not just for the top and right).  This makes me think that I'm missing a processing of scale before using the matrix.  So, I evolve with AVPageViewGetPageToDevScaling and get x.  The scale on both axes I get is 1.527771.  I apply the multiplication of matrices, and I get [3.055542, 0, 0,-3.055542, 0, 1210].

    Applied to my original rectangle, I get 0, 1179, 31, 1210.  Still not working.  If I subtracted the zoom factor (1.0) of the scale, that annoys me more close (0, 1199, 11, 1210), but still not quite there.  What Miss me?

    I can't use AVPageViewRectToDevice because I work in a multithreaded by need context and it is not safe to call AVPageViewSetPageNum after that I started the thread where I do this work.

    Thank you

    Daniel

    I found the problem.  It has been rounded off error in the scale in the matrix factor.  I wonder ASFixedRoundToInt32 to values that returned from AVPageViewGetPageToDevMatrix, but I had to do was to apply ASFixedToFloat.  The resulting matrix is [1.527771, 0,-1.527771, 0, 0, 1210], and it produces the correct results.

  • VertexShader - parameter / matrix editions

    I'm trying to implement a simple shader mask for my 2D engine and I have several problems to make it work.

    Basically the shader takes two images and two matrices and tries remap back the position of vertices in the vertex sprites to the position of the local space mask then calculates the local uv coordinates for the mask, but I'm stuck with a few calculations base here.

    Bug 1: Divisions of the core hardware vertex work not at all. That's why I put invertedMaskSize (which is 1.0 / 128,0) in the shader (but we already know that )

    Bug 2: interpolated vars must be float4, float2 isn't possible (it's a pretty old bug as well)

    I tried the following changes in the shader. The shader posted here, just try to display the uv coordinates resulting. No texture is used.

    Case 1:

    float4 ((vertexPos.x + halfMaskSize.x) = interpolatedMaskUV * invertedMaskSize.x, (vertexPoss.y + halfMaskSize.y) * invertedMaskSize.y, 0.0, 0.0);

    The output is as follows: http://dev.nulldesign.de/plain_uvcoords.PNG Just like you expect! Perfect, we'll proceed.

    Case 2:

    Change the halfMaskSize and the invertedMaskSize to float2 and set the parameters in the form of two vectors of length two of course in ACE. Output: http://dev.nulldesign.de/float2_uvcoords.png

    Case 3:

    Masking test, the multiplication of matrices. First calculate the position of the global space of the vertex:

    float4 worldSpacePos = float4 (vertexPos.x, vertexPos.y, 0.0, 1.0) * objectToClipSpaceTransform;

    It maps then back to the local space of the mask:

    float4 localMaskSpacePos = worldSpacePos * maskObjectToClipSpaceTransform;

    And calculating the uv coords:

    float4 ((localMaskSpacePos.x + halfMaskSize.x) = interpolatedMaskUV * invertedMaskSize.x, (localMaskSpacePos.y + halfMaskSize.y) * invertedMaskSize.y, 0.0, 0.0);

    For the test, I put the maskObjectToClipSpaceTransform in contrast to the objectToClipSpaceTransform. In theory and on paper, it should work.

    But, I think, something is happening in disorder and maybe the maskObjectToClipSpaceTransform is screwed in the shader, just as when I put the halfMaskSize and the invertedMaskSize to float2. The result is the following: http://dev.nulldesign.de/local_uvcoords.png and I don't have any idea how to resolve this...

    < languageVersion: 1.0; >
    texture core materials
    <
    namespace: "ND2D_Shader";
    Seller: "nulldesign;
    version: 1;
    >
    {
    top of entry float2 uvCoord
    <
    ID: "PB3D_UV";
    >;

    top of entry float2 vertexPos
    <
    ID: "PB3D_POSITION";
    >;

    parameter float2 uvOffset;
    parameter float4x4 objectToClipSpaceTransform;
    parameter float4x4 maskObjectToClipSpaceTransform;

    If the float2 value, strange things happen

    parameter float4 halfMaskSize;
    parameter float4 invertedMaskSize;

    interpolated float4 interpolatedUV;
    interpolated float4 interpolatedMaskUV;

    Sub evaluateVertex()
    {
    not used in the current test...

    interpolatedUV = float4 (uvCoord.x + uvOffset.x, uvCoord.y + uvOffset.y, 0.0, 0.0);

    float4 worldSpacePos = float4 (vertexPos.x, vertexPos.y, 0.0, 1.0) * objectToClipSpaceTransform;

    does not work as expected

    float4 localMaskSpacePos = worldSpacePos * maskObjectToClipSpaceTransform;

    float4 ((localMaskSpacePos.x + halfMaskSize.x) = interpolatedMaskUV * invertedMaskSize.x,)
    (localMaskSpacePos.y + halfMaskSize.y) * invertedMaskSize.y,.
    (0.0, 0.0);
    }

    image4 input textureImage;
    image4 input textureMaskImage;
    parameter of float4 color;

    output float4 result;

    Sub evaluateFragment()
    {
    just view the uv coords

    result = float4 (interpolatedMaskUV.x, interpolatedMaskUV.y, 0.0, 1.0);

    /*
    texel sample = float4 (textureImage, float2 (interpolatedUV.x, interpolatedUV.y), PB3D_2D |) PB3D_MIPNEAREST | PB3D_CLAMP);
    float4 texel2 = sample (textureMaskImage, float2 (interpolatedMaskUV.x, interpolatedMaskUV.y), PB3D_2D |) PB3D_MIPNEAREST | PB3D_CLAMP);

    result = float4 (texel.r * color.r,)
    Texel.g * color.g,.
    Texel.b * color.b,.
    Texel.a * color.a * texel2.a);
    */
    }
    }

    I know that we are working with an old version of four months of pb3d and I hope that a new version will be out soon and maybe all these bugs that I have met are already solved, but if it isn't... Here is an another shader to fix

    I just discovered another question when I worked through your example. If you have a parameter that is used by the kernel of vertex and a parameter that is used by the material evaluateVertex of the core function, they must have different names, even though they are supposed to be the same value. The particular setting that gave me the wrong is objectToClipSpaceTransform. I use it in my kernel of vertex standard, but it is also used in your example as an input to the function evaluateVertex.

    We have not yet worked which is the right way to deal with this situation, for the moment, the work around is to make sure that the settings are two different names.

    Bob

  • Multiplication of cross-checking (circular convolution)

    Hello

    To make the circular convolution of vectors, I would like to make:

    FFT-> multiplication cross-check (W = u * V in MATLAB)-> IFFT

    for example [1 1 1 1 0 0 0 0] with himself-> [1 2 3 4 3 2 1 0]

    Is there an easy way to do this multiplication on the 50g, or a cross-check order direct cconv?

    Thanks in advance

    Hi, yYou can use the same commands with the 50G

    FFT

    IFFT

    For cross-checking multiplication on the 50g, try HADAMARD / / shift MATRICES OPER NXT HADAM

    RPL mode

    [1 2 3] [4-5-6] HADAMARD

    [4-10-18]

    In rpl:

    [ ... ]

    [ ... ]

    FFT

    HADAMARD

    IFFT

  • CUDA Matrix Multiplication fails

    Hello

    I am trying to expedite my application by moving some operations of heavy matrix on the GPU. Given that I have never created a block diagram to run on the GPU to date, I did a simple example to see how things work. The screenshot of the VI I wrote is attached.

    Simply, it initializes the device and the LVCUBLAS library. It allocates memory for matrices, it will use and uploads the data to the device; calculate the multiplication. However, even if I am not getting any error, the result get, which should be [2, 2], is not correct. What I get, it is essentially the C vector, which is [0,0].

    Am I missing something?

    Thank you in advance for help you.

    Hi man,

    Finally, I got it working. I post my solution here, because it might be useful to others.

    The problem is that the latest version of the CUDA, 7.5 Toolbox, has only 64 bits of the cublas and cufft library versions. Therefore, they cannot be called by Labview 32 bit (I actually tried to force Labview to do this, but I got an error, and that is the explanation http://digital.ni.com/public.nsf/allkb/6C2CEE5925B8C1B08625721A00731B5E).

    I could install Labview 64-bit, but I'm also using the FPGA module, which requires Labview 32 bit, as pointed out here http://www.ni.com/pdf/manuals/374737b.html

    I cant even install the 32-bit CUDA Toolkit from a previous version (6.5), as my machine is a Windows 7 64-bit.

    Then I overcame all this simply by copying the libraries cublas32_65.dll and cufft32_65.dll of the CUDA Toolkit 6.5 installer and pasting in the CUDA Toolkit 7.5 folder installed on my machine.

    I hope this can help.

  • IPhone 7 will accept multiple fingerprints using the key ID?

    IPhone 7 will accept multiple fingerprints using the key ID?  If so, how?

    My iPhone 5 allows you to set up several fingerprints via settings > Touch ID & password, I doubt that the iPhone 7 would have fewer features.

    (I asked for your message to be moved to the forum from iPhone to help, do not know why you decided to post on the forum to help iPad.)

  • How can I multiply two matrices together in number?

    How can I multiply two matrices together in number?

    Well, there is a function in numbers call sumproduct() that can help you.  Post a screenshot of what you will help us to better help you.

    real matrix operations are not supported in number.

  • Download iOS 10 update once for installation on multiple devices via iTunes?

    I think remember me that it was possible and it was the best way. When I Googled it I am surprised to find there is no recent information on this (last year, although there are responses from 2012). I think this means 'no', but have not found the answer either.

    Then, download iOS updated once for installation on multiple devices via iTunes? As many people have multiple iOS devices that's probably a good idea.

    Almost certainly not.

    Each version of the product Apple has its own download.

  • setting up multiple files for storage on the sidebar in mail

    How can I configure multiple files storage on the sidebar in mail

    Mail/Mailbox/new mailbox. Generally better to create the mailbox on my Mac when it is used for storage.

Maybe you are looking for