Skip to main content

Create a script file to generate NxN matrix in form like below image

Also Read

generate NxN matrix using MATLAB

MATLAB script file to create NxN matrix:


clc   %Clear screen
clear all  % Clear all the workspace variables
m=input('Enter the number:');% Ask for input the number of rows and columns value
x=[1 2];    % Type of elements required
Y=[];    % initiate null matrix Y
for i=1:(m*m)
    Y=[Y x];
end
k=1;
Z=[];
for i=1:m
    for j=1:m
        Z(i,j)=Y(k)
        k=k+1;
    end
end


MATLAB script to create NxN matrix



Comments

Recent posts

TIN SMITHY VIVA QUESTIONS AND ANSWERS

VIVA QUESTIONS What is the raw material used in Tin smithy for doing experiments Classify the tools used in Tin smithy Name some measuring tools Name some marking tools Name some cutting tools Name some finishing tools What is the use of Nylon mallet What is the purpose of given tool Differentiate between mallet and Hammer Differentiate between straight snip and curved snip What is the purpose of snip What is the use of anvil What is the purpose of Stake What is the use of scriber What is use of cutting plier What is the supporting tool used to obtain the final shape of the model What type of development is applied for Plain Pipe What type of development is applied for Rectangular tray What type of development is applied for Funnel What is the full form of SWG Tell some precautions should be taken in Tin Smithy Trade What are the various types of hammer What do you mean by Galvanization Draw any sheet metal joint symbols Name different parts of anvil What

TIN SMITHY & Sheet metal

TIN SMITHY Introduction : Many engineering and house articles such as boxes, cans, funnels, ducts etc. are made from a flat sheet of metal. The process being known as tin smithy. For this the development of the article is first drawn on the sheet metal, then cut and folded, to form the required shape of the article. Allowance should be given in the drawing stage for folding and bending. This allowance depends upon the radius of the bend and thickness of the sheet metal. Sheet Metal Materials : A variety of metals are used in a sheet metal shop such as galvanized Iron, black, Iron, tin, Stainless Steel, copper and Aluminium. Hand Tools : The common hand tools used in sheet metal work are steel, try square, Wire gauge, Scriber, Ball peen hammer, Nylon Mallet, Snips Divider, Stakes, Cutting plier and Soldering Iron. Here, the details of tools that are being equipped by our workshop purpose only are presented. Wire Gauge: The thickness of sheet is referred in numbers known

Carpentry Viva Questions

Q1: Define carpentry? Ans:  Carpentry is a skilled trade that involves working with wood to construct, install, and repair structures and objects. It encompasses various tasks such as measuring, cutting, shaping, joining, and finishing wood to create functional and aesthetically pleasing products. Q2: What are the various types of wood material used in carpentry? Ans:  The various types of wood materials used in carpentry include softwoods (such as pine, fir, cedar, and spruce) and hardwoods (such as oak, maple, mahogany, and walnut). Other wood materials used in carpentry can include plywood, particleboard, MDF (medium-density fiberboard), and engineered wood products like laminated veneer lumber (LVL) and oriented strand board (OSB). Q3: What is the sequence of operations in carpentry? Ans:  The sequence of operations in carpentry typically involves planning and design, material selection and preparation, measuring and marking, cutting and shaping, joinery or fastening, assembly,

Welding-LAP JOINT

Ex. No :                                                                              Date : LAP JOINT Aim To join the given two work pieces as a lap joint by arc welding. Material used Mild Steel plates. Tools required Welding power supply  Flat file Welding rod Chipping hammer Electrode holder Wire brush Gloves and apron Earthing clamps Shield and goggles Procedure The given workpieces are thoroughly cleaned, i.e. rust, scales are removed and the  edges are filed. The electrode is held in an electrode holder and ground clamp is clamped to the  welding plates and the power is supplied. The workpieces are positioned on the table to form a “Lab joint”. The tag weld is done on the both the ends of joining plates to avoid the movement of  workpieces during welding. The welding is carried throughout the length of the workpieces on both sides by  maintaining 3mm gap between plates and the welding rod. The welded plates are allowed f

Fluid mechanics VIVA QUESTIONS and ANSWERS

1. Define density? Ans: It is defined as the ratio of mass per unit volume of the fluid. 2. Define viscosity? Ans: It is defined as the property of fluid which offers resistance to the movement of fluid over another adjacent layer of the fluid. 3. Differentiate between real fluids and ideal fluids? Ans: A fluid, which is in-compressible and is having no viscosity, is known as ideal fluid while the fluid, which possesses viscosity, is known as real fluid. 4. What is a venturimeter? Ans: It is a device which is used for measuring the rate of flow of fluid flowing through pipe. 5. What is a notch? Ans: A notch is a device used for measuring the rate of flow of a fluid through a small channel or a tank. 6. Define buoyancy? Ans: When a body is immersed in a fluid, an upward force is exerted by the fluid on the body. This upward force is equal to the weight of the fluid displaced by the body. 7. Define meta-centre? Ans: It is defined as the point about which a body

Welding VIVA question and answers

VIVA QUESTIONS : Q1: Define welding? Ans:  Welding is a fabrication process that joins two or more materials, typically metals or thermoplastics, by melting and fusing them together using heat or pressure. Q2: What is the typical thickness of MS Plate used in general welding workshop experiments? Ans:  The thickness of the MS (Mild Steel) plate used in general welding workshop experiments can vary depending on the specific requirements of the experiment. However, commonly used thicknesses range from 3 mm to 12 mm. Q3: What is the common job material used in welding experiments? Ans:  The common job material used in welding experiments is mild steel. It is widely available, affordable, and relatively easy to work with, making it suitable for various welding applications and practice. Q4: What is the main function of an electrode in welding? Ans:  The main function of an electrode in welding is to carry the electric current necessary for the welding process and to provide filler mate

TAPER TURNING

Ex. No :                                                                                                   Date : TAPER TURNING USING COMPOUND REST Aim To get a required shape and size from a given workpiece by taper turning operations in the lathe. Material used Mild steel rod.. Tools required Single point cutting tool Lathe Vernier caliper Try square Chuck key Procedure First loosen the jaw in the chuck key to position the work piece, and then tighten the  jaws. Fix the cutting tool in the toolpost. Switch on the lathe and move the carriage near to the orkpiece. Give it a small cross  feed, and then move carriage ongitudinally to the required length slowly. Bring the carriage to the original position, give a small cross feed and move carriage  longitudinally. Repeat this step until required diameter is obtained. To get smooth surface give a very small feed when the diameter is nearing the  required value. To face the end surface of the workpi

SolidWorks Practice parts

Solidworks practice parts Click here to view step by step process to make these basic shapes using solidworks Exercise 1 Exercise 2 Exercise 3 Exercise 4 Exercise 5 Exercise 6 Exercise 7 Exercise 8 Exercise 9 Exercise 10 Exercise 11 Exercise 12 Exercise 13 Exercise 14 Exercise 15 Exercise 16 Exercise 17 Exercise 18 Exercise 19 Exercise 20 Exercise 21 Exercise 22 Click here to view step by step process to make this shape using solidworks

sheet metal rectangular tray making

Aim :- To make a rectangular tray from a given metallic sheet. Tools Required MALLET Snip Stake STEEL RULE Ball peen HAMMER Straight EDGE RIVETS Scriber Procedure The given metal sheet is smoothed using mallet. The measurements of rectangular tray (tray development drawing) is drawn on the sheet with given dimensions using the scriber and steel rule. The sheet is cut as per the marked dimensions by straight snips. Fold or bend as per the given order using mallet and stake. Bending is done as per the given dimension using the stake and mallet. Rivet the folded sheet by using the given rivets and hammer. Safety Precautions Each cut you make exposes sharp edges and creates burrs that can slice a finger. Must Use Hand gloves when cutting the sheet. Metal waste also has hazardous edges. So

FACING, PLAIN TURNING AND STEP TURNING

Ex. No :                                                                                                          Date : FACING, PLAIN TURNING AND STEP TURNING Aim                       To perform turning, facing and chamfering on a cylindrical work piece. Material used                       Mild steel cylindrical rod. Tools required Lathe Three-jaw chuck Chuck key Vernier caliper Single-point cutting tool Procedure First loosen the jaw in the chuck key to position the work piece, and then tighten the  jaws. Fix the cutting tool in the toolpost. Switch on the lathe and move the carriage near to the workpiece. Give it a small cross  feed, and then move carriage longitudinally to the required length slowly. Bring the carriage to the original position, give a small cross feed and move carriage  longitudinally. Repeat this step until required diameter is obtained. To get smooth surface give a very small feed when the diameter is nearing

Search This Blog