Lädt...

🔧 matrix multipilication,matrix addision


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

matrix multipilication:

package afterfeb13;

public class matrixmulti {
    public static void main(String[] args) {
        int[][] a = { { 1, 3, 5 }, { 5, 6, 7 }, { 1, 2, 3 } };
        int[][] b = { { 1, 8, 5 }, { 5, 9, 7 }, { 1, 7, 3 } };
        int[][] c = new int[a.length][a[0].length];
        for (int row = 0; row < a.length; row++) {
            for (int col = 0; col < b[0].length; col++)

            {
                for (int k = 0; k < b.length; k++) {
                    c[row][col] += a[row][k] * b[k][col];// c[0][0] = (a[0][0] * b[0][0]) + (a[0][1] * b[1][0]) +
                                                            // (a[0][2] * b[2][0])
//=(1*1)+(2*5)+(5*1)=21//(1*8)+(2*9)+(5*7)=70//(1*5)+(2*7)+(5*3)=21//it represent row *col
                }
                System.out.print(c[row][col] + " ");
            }
            System.out.println();
        }

    }

}

Output:

21 70 41
42 143 88
14 47 28

Reference:https://www.geeksforgeeks.org/java-program-to-multiply-two-matrices-of-any-size/

matrix addision:

package afterfeb13;

public class matrixadd {
    public static void main(String[] args) {
        int[][] a = { { 1, 3, 5 }, { 5, 6, 7 }, { 1, 2, 3 } };
        int[][] b = { { 1, 8, 5 }, { 5, 9, 7 }, { 1, 7, 3 } };
        int[][] c = new int[a.length][a[0].length];// temp con

        for (int row = 0; row < a.length; row++) {
            for (int col = 0; col < b[0].length; col++)

            {

                c[row][col] = a[row][col] + b[row][col];
                System.out.print(c[row][col] + " ");
            }
            System.out.println();

        }

    }

}

Output:
2 11 10
10 15 14
2 9 6

Reference:https://www.geeksforgeeks.org/java-program-to-add-two-matrices/

...

🔧 matrix multipilication,matrix addision


📈 94.06 Punkte
🔧 Programmierung

📰 Matrix 1.0 und die »Matrix.org Foundation« vorgestellt


📈 17.39 Punkte
📰 IT Nachrichten

🎥 Matrix Live S08E31 — Element Call Encryption, Linearised Matrix


📈 17.39 Punkte
🎥 Video | Youtube

🎥 Matrix Tutorial#14 – Bridging Discourse to Matrix


📈 17.39 Punkte
🎥 Videos

🎥 Matrix Live S08E23 — MLS, Matrix Public Archive, Element X


📈 17.39 Punkte
🎥 Video | Youtube

🎥 Matrix Live S01E03 - Matrix Live Demos


📈 17.39 Punkte
🎥 Video | Youtube

🐧 Introducing Matrix 1.0 and the Matrix.org Foundation


📈 17.39 Punkte
🐧 Linux Tipps

🕵️ CVE-2023-26922 | Varisicte matrix-gui 2.0 matrix-gui-2.0 shell_exect sql injection


📈 17.39 Punkte
🕵️ Sicherheitslücken

🐧 ascii-matrix: render ascii art + matrix effect


📈 17.39 Punkte
🐧 Linux Tipps

🎥 Matrix 2.0 — How we're making Matrix go voom!


📈 17.39 Punkte
🎥 IT Security Video

🕵️ CVE-2024-42369 | matrix-org matrix-js-sdk up to 34.3.0 leaveRoomChain recursion


📈 17.39 Punkte
🕵️ Sicherheitslücken

🐧 FOSDEM 2023: Matrix 2.0 — How we're making Matrix go voom!


📈 17.39 Punkte
🐧 Linux Tipps

🎥 Matrix Live S09E37 - A sneak peek at the Matrix 2.0 endgame


📈 17.39 Punkte
🎥 Video | Youtube

💾 Google Flights Matrix - Google Matrix Airfare Search (ITA Software) Deutsch


📈 17.39 Punkte
💾 Downloads

🐧 Matrix: Would it be reasonable to run a matrix home server in a basic VPS?


📈 17.39 Punkte
🐧 Linux Tipps

🕵️ matrix-media-repo up to 1.2.6 on Matrix resource consumption


📈 17.39 Punkte
🕵️ Sicherheitslücken

🎥 Arch Conf 2020 - Enter the Matrix: Install your own Matrix server on Arch Linux


📈 17.39 Punkte
🎥 IT Security Video

🎥 Matrix Live S09E31 — The Matrix Conference


📈 17.39 Punkte
🎥 Videos

🐧 Combating abuse in Matrix - without backdoors (Matrix blog)


📈 17.39 Punkte
🐧 Linux Tipps

📰 Matrix 5: Mehr Matrix ist ein Grund zur Freude!


📈 17.39 Punkte
📰 IT Nachrichten

🔧 Summed Matrix | GeeksforGeeks‬ Beginner's DSA Sheet | Matrix Problems | With Source Code


📈 17.39 Punkte
🔧 Programmierung

📰 The Matrix: Matrix 4 mit Keanu Reeves kommt früher als erwartet


📈 17.39 Punkte
📰 IT Nachrichten

🎥 Matrix Live S09E21 — Matrix & Element demos!


📈 17.39 Punkte
🎥 Videos

🔧 Matrix Addition,Matrix Multipliction


📈 17.39 Punkte
🔧 Programmierung

🐧 Introducing P2P (peer-to-peer) Matrix | Matrix.org


📈 17.39 Punkte
🐧 Linux Tipps

🎥 Matrix Live S09E20 — Moodle adopts Matrix


📈 17.39 Punkte
🎥 Videos

🎥 Matrix Live S10E15 – NGI Commons builds a community on Matrix


📈 17.39 Punkte
🎥 Videos

📰 Lumos Matrix: "Next-Gen"-Helm mit LED-Matrix bei Apple verfügbar


📈 17.39 Punkte
📰 IT Security Nachrichten

🎥 Matrix Live S09E18 — Matrix crypto update. Able to decrypt?


📈 17.39 Punkte
🎥 Video | Youtube

🎥 Matrix Live S10E12 — Worms, but on Matrix


📈 17.39 Punkte
🎥 Video | Youtube

🐧 New Vector (developers of Matrix) raises $8.5M to accelerate Matrix/Riot/Modular


📈 17.39 Punkte
🐧 Linux Tipps

🎥 Matrix Live S09E17 — Element X, Call and Matrix Auth Service updates


📈 17.39 Punkte
🎥 Videos

matomo