Answered
How to solve these two problems in Matlab?
Dear Kaimeng, here is code for this: m = input('Input value for m:'); arr = zeros(1, m); for i = 1:m arr(i) = ...

12 years ago | 0

| accepted

Answered
How to apply the sum function of a factorial equation without using the factorial function
Dear Anj, do you need something like this: i = 1:20; val = sum(2.^i);

12 years ago | 0

| accepted

Answered
Finding Max Distance between coordinates
Dear Prabs, here is an example code which you can use for this purpose: x = 1:10; % x component of coordinate y = 2:2:20...

12 years ago | 2

Answered
How would I write a code to solve a system of equations?
Dear Omar, you can solve your system of equations using the following way: t = sym('t%d', [1 2]); q1 = 1.53e-5 * t(1)^4 ...

12 years ago | 1

Answered
How I can plot the magnitude and phase response oh the function
Dear Helda, here is an example showing amplitude and phase plots of your defined function: t = 1:100; y = 4 * sin(50 * t...

12 years ago | 1

Answered
12 lead ECG graph problem
Dear Stephen you can do like this: plot(x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6, x7, y7, x8, y8, x9, y9, x10, y10, x...

12 years ago | 0

Answered
for del=-1:0.5:1, i want to get the index of the value of del being used for that specific iteration . can anyone please tell me a way to do this
Dear Qasim, the index in the 2nd value of del will be 2. You can do like this: count = 1; for del = -1:0.5:1 fprint...

12 years ago | 0

| accepted

Answered
Stairs Command MATLAB Ends
Dear T, I think you can do as follows (If i understood correctly) figure X = linspace(0,4*pi,40); Y = sin(X); stairs(...

12 years ago | 0

| accepted

Answered
how can i take xls file from the user in gui and use it on the xlsread after in my proggram?
Dear Eraklis, You can do like this (for example, in a callback of a button): [FileName,PathName] = uigetfile({'*.*'; '*.xls...

12 years ago | 1

Answered
How can I enlarge the font size in program and help?
Dear Hamidreza, You can adjust text properties using text_prop. See following link for more information: <http://www.mathworks.c...

12 years ago | 0

Answered
Error message confusion, help!
Dear Edward, I tried following and it is working properly: x = 1:10; y = 2:2:20; dP = (100 / (std(y) * (2 * pi)^0.5))...

12 years ago | 0

Answered
dB scale (log scale) of a polar plot graph
Dear Atarli, Here is the conversion to decibel: result =(((cos(theta)).*(sin((x/2).*sin(theta))/(x/2).*sin(theta)))); ...

12 years ago | 0

Answered
Two problems regarding for loops
Dear Paul, Here is the solution for your task (2): x = 1:10; y = x; y2(1:2:9) = y(1:2:9) + 0.25; y2(2:2:10) = y...

12 years ago | 1

Answered
Polar Plotting Aperture Antennas in E and H plane
Dear Atarli, here is the code for your equations if I understood correctly: theta = 0.01:0.01:2 * pi; a = 1; b = 1; ...

12 years ago | 0

Answered
when i try to read number of images from a file in to a program using the "cell" matlab is showing error? Pleasing help me with reading number of images from a file into a single program !!
Dear Vijay, here is correction in your code: n = 2; images = cell(1,n); for i=1:n images{i} = imread(strcat('f...

12 years ago | 0

| accepted

Answered
How can I read in rows from an Excel spreadsheet iteratively?
Dear Jon, You can read excel file iteratively using for loop as follows: count = 1; n = 1888; increment = 10; for ...

12 years ago | 0

Answered
How can I interpolate a vector into a shorter one?
In case that you want to make longer vector shorter you can use some manipulation(For example I call it forward manipulation). F...

12 years ago | 0

Answered
Displaying least assigned value
Dear Taimur Saleem, Here is the code which do it: var1 = 6; var2 = 1; difference = mod((var1 - var2),3); if di...

12 years ago | 0

Answered
where is fitglm function in statistic Toolbox of 2013a
Dear Bassam, Use "ver" at command window to check whether you have statistics Toolbox installed or not. If it is not installed...

12 years ago | 0

Answered
How can I isolate data from a large input file?
Dear Rob, here is the solution to your problem: A = [0 0 0 0 0 0 1 0 0 0 0 0 0 -1 0 0 0 0 0 0 1 0 0 -1 0 0 1]; indx = [1...

12 years ago | 1

Answered
Missing value: Adding new row of NaN in a time series. Need some twist in code
Dear Khandu, you can insert NaN at missing location as follows: A_matrix = rand(122,20,30); [nmonths, nlat, nlon] = size...

12 years ago | 1

| accepted

Answered
Set listbox with excel content --Attempt to reference field of non-structure array
Dear Manual, I assume that "text" just has one cell then you do like this: [ndata, text, alldata] = xlsread(filename); s...

12 years ago | 0

Answered
Numerate lines to a text file
Here is an example for your problem: A = rand(100, 3); num = 1:100; B = [num' A]; disp(B) dlmwrite('filename.txt'...

12 years ago | 0

Answered
how to read a text file and read it line by line?
Dear Behrad, here is the complete code for your problem: fid = fopen(filename); % Insert here the file name with complete f...

12 years ago | 1

| accepted

Answered
devi method of finding root
Dear Unhappy, here is the solution if I understood your problem correctly: syms a_sym b_sym x_sym = a_sym + 1j * b_sym; ...

12 years ago | 0

| accepted

Answered
How can i do fast Fourier transform for matrix of images with Matlab?
You can use "fft" function. See for more information: <http://www.mathworks.com/help/matlab/ref/fft.html>

12 years ago | 0

Answered
How to create a Contour plot?
Dear Ashley, in order to create contour plot you need to have Z as a matrix not as a vector. Also if you have X and Y vectors of...

12 years ago | 0

Answered
Plotting a Piecewise function
Dear Lauren, do you need following functionality in your code: j = 1:56; t = zeros(1, length(j)); for i = 1:56 ...

12 years ago | 0

Answered
multiple arguments in function
Dear Parul, You can use "varargout" for any number of output arguments. So in your case function [varargout] = train() ...

12 years ago | 0

| accepted

Load more