Skip to content
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
This repository is a test toolbox for Scilab. It requires "thirdparty" directory which can be downloaded as "external-library.zip" file from the page: https://scilab.in/fossee-scilab-toolbox. The "thirdparty" directory contains compiled library for a simple "multiplication" function written in C. After copying the "thirdparty" directory to the toolbox directory, on the scilab console run "exec builder.sce" to build the toolbox and then run "exec loader.sce" to load the toolbox. Type "help" in the scilab console and browse through the help content of "test_toolbox". The external-library.zip file also contains separate instructions to work with MinGW on Windows OS.
Documentation by : B C Sagar,as a part of Phase one FOSSEE SEMESTER long Internship Screening task by IIT Bombay for Scilab toolkit optimization.

This toolbox overall demonstrates
1. How to add a function defined in C in scilab
2. How to add a function defined in Scilab in Scilab
3. How to write help for the added functions
4. How to create a toolbox out of the above functions.
This repository is a test toolbox for Scilab. It requires "thirdparty" directory which can be downloaded as "external-library.zip" file from the page:
https://scilab.in/fossee-scilab-toolbox. The "thirdparty" directory contains compiled library for a simple "Transpose" function written in C. After copying the
"thirdparty" directory to the toolbox directory, on the scilab console run "exec builder.sce" to build the toolbox and then run "exec loader.sce" to load the
toolbox. Type "help" in the scilab console and browse through the help content of "test_toolbox". The external-library.zip file also contains separate instructions to work with Mint Linux.


This toolbox overall demonstrates:

1. a stand alone C function that computes transpose of a nxm matrix. Name the file as “trans.c”

2. a main file to call the C function.

3. a folder named “test” inside the repository. Copied my working “trans.c” file and “main.c” file inside this folder.

4. a shell script with a series of commands to compile and execute the “trans.c” and “main.c” file. I have copied the working shell script file inside the “test” folder.
1 change: 1 addition & 0 deletions Test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

16 changes: 16 additions & 0 deletions test/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<stdio.h>
main() {
int a[10][10], transpose[10][10], r, c, i, j;
printf("Enter rows and columns: ");
scanf("%d %d", &r, &c);

// Assigning elements to the matrix
printf("\nEnter matrix elements:\n");
for (i = 0; i < r; ++i)
for (j = 0; j < c; ++j) {
printf("Enter element a%d%d: ", i + 1, j + 1);
scanf("%d", &a[i][j]);
int transpose(r,c,a[i][j]);
}


22 changes: 22 additions & 0 deletions test/trans.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <stdio.h>

#include <stdlib.h>
#include <string.h>
int transpose(int r,int c,int a[i][j])

// Finding the transpose of matrix a
for (i = 0; i < r; ++i)
for (j = 0; j < c; ++j) {
transpose[j][i] = a[i][j];
}

// Displaying the transpose of matrix a
printf("\nTranspose of the matrix:\n");
for (i = 0; i < c; ++i)
for (j = 0; j < r; ++j) {
printf("%d ", transpose[i][j]);
if (j == r - 1)
printf("\n");
}
return 0;
}