How to run m-file from another m-file by input string
I do that some times just by doing this: another_script = input('script name: ','s'); % and type the name of your other scr...

7 years ago | 0

matrix or array composed by zero-values
try with any(all(M)) any(all(M)) = 0 when every element of M equals 0

7 years ago | 0

How to view an image from the side?
Take a look at the built-in function _view_: help view doc view

7 years ago | 0

| accepted

If else if statement problem
You can solve the issue rounding the value of _c_: %Problem occurs here, if c = 1, else statement is displayed instead e...

7 years ago | 1

| accepted

cell array to string array
If your cell array is this: fp31={'#CC','#CB','#CN','#CO','#CP','#CF','#CS','#CI','#CQ','#CW'}; access the elements usin...

7 years ago | 1

how do i plot a graph with pixel matrix?
It is not very clear what you want, but I think it could be this: Result = [368.8496 41.0974]; Result1 = [18.8326 96...

7 years ago | 0

How can I change the name of my vector of each iteration?
Use _eval_: S = rand(3,1); % sample data to test the script n = length(S); for ii = 1:n; a = M(ii,1); b =...

7 years ago | 0

| accepted

Multiply a 3D matrix with 2d matrix to get a vector
The only solution that suits the dimensions of the matrices is this: Y = rand(3);% Y is a 3x3 matrix Z = rand(6,1);% Z i...

7 years ago | 0

convert time stamp into minutes or seconds

7 years ago | 0

Plotting a 2D matrix
Maybe you are thinking no something like this: M=rand(300,42); % your data here [xx, yy] = meshgrid(1:42,1:300); ...

7 years ago | 0

Reading specific data from an excel file
I think it would be better to read just once the *.xls file, since it is a time-consuming process. And moreover, after reading ...

7 years ago | 0

how can i go back to the fist choose again with out termination after finshing the first task?
Use a while-loop: mynumber = 0; while (mynumber ~= 3) % condition to get out of the loop. Change to your n...

7 years ago | 0

| accepted

How do I convert a .m file into .exe file??
use the _deploytol_ to create an *.exe from your project. Take a look at the documentation, where you will find examples to g...

7 years ago | 0

| accepted

why the error is coming?
who is _x_? That message is the result of trying to access an non-existent element of the array, such as x(0). Make sure _...

7 years ago | 0

| accepted

How can I save a .dat file?
take a look at the documentation of _fprintf_ doc fprintf You will find right what you need

7 years ago | 0

How declare a global vector
The fact of being a global variables has nothing to do with its dimension. The following is perfectly valid: global v v...

7 years ago | 0

Problem in while loop when input is characters or words
You do not say who is either _W_ or _choiceNum_, but with the two variables in play, you can do it like this. Watch the capit...

7 years ago | 0

how i divide n images present in a folder into 4 equal parts
Filename=strcat('fruits\',srcFiles(i).name); I=imread(Filename); imshow(I) [x,y, z]=size(I) I_1 = I(1:x/2,1:...

7 years ago | 1

How do i create a hole or cut a certain portion of a plane in GUI?
x = [0 100 100 0]; y = [0 0 100 100]; z = [0 0 0 0]; fill(x,y,'b') x_hole = [40 60 60 40]; y_hole = [40 40 60 6...

7 years ago | 0

Significance of the (.) operator
The means the product is performed element-wise in both matrices on wither side of the product sign: Example: a=[1 2 3];...

7 years ago | 0

Help writing a simple function
You should do as Azzi Abdelmalek says, anyway, here is your code: if x<4 f = -1; elseif x>=4 && x<=4 f = ...

7 years ago | 0

How can I shift rows and columns, and also replicating Sub matrixes.
A = magic(4); D = [A(end,:); A(1:end-1,:)]; % shift rows down D = [D(:,3:end) D(:,1:2)]; % shift colums leftx2 ...

7 years ago | 0

How can save sveral images using different names in a single pogram
Adapt the following to your needs: N_pics = 10; % change this to your needs for k=1:N_pics pic_left = sprintf('l...

7 years ago | 1

| accepted

Plotting a Hexagon shape in matlab
To Draw any polygon: scale = 5; N_sides = 6; t=(1/(N_sides*2):1/N_sides:1)'*2*pi; x=sin(t); y=cos(t); x=scal...

7 years ago | 0

| accepted

Looping over function string arguments
In the second method you are passing a cell array as input argument. Try this: interpolation={'bilinear', 'bicubic'}; ...

7 years ago | 1

| accepted

Can Letter U appear in one amino acids sequence?
As you can see, for example in this link: http://www.hgvs.org/mutnomen/codon.html U can not be in the sequence

7 years ago | 0

| accepted

Can Letter U appear in one amino acids sequence?
Your sequences are not of the same length, when A is restricted to same size than B, you do not get the error: A = 'MGCAEGK...

7 years ago | 0