Respondida
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) = ...

más de 12 años hace | 0

| aceptada

Respondida
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);

más de 12 años hace | 0

| aceptada

Respondida
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...

más de 12 años hace | 2

Respondida
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 ...

más de 12 años hace | 1

Respondida
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...

más de 12 años hace | 1

Respondida
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...

más de 12 años hace | 0

Respondida
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...

más de 12 años hace | 0

| aceptada

Respondida
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(...

más de 12 años hace | 0

| aceptada

Respondida
I have a matrix 'a' and i want to calculate the distance from one point to all other points. So really the outcome matrix should have a zero (at the point I have chosen) and should appear as some sort of circle of numbers around that specific point.
Dear Sarwar, following is an example code as you desired: A = rand(5, 5); select_cell = [3 3]; distance = zeros(size(...

más de 12 años hace | 0

| aceptada

Respondida
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...

más de 12 años hace | 1

Respondida
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...

más de 12 años hace | 0

Respondida
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))...

más de 12 años hace | 0

Respondida
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)))); ...

más de 12 años hace | 0

Respondida
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...

más de 12 años hace | 1

Respondida
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; ...

más de 12 años hace | 0

Respondida
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...

más de 12 años hace | 0

| aceptada

Respondida
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 ...

más de 12 años hace | 0

Respondida
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...

más de 12 años hace | 0

Respondida
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...

más de 12 años hace | 0

Respondida
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...

más de 12 años hace | 0

Respondida
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...

más de 12 años hace | 1

Respondida
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...

más de 12 años hace | 1

| aceptada

Respondida
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...

más de 12 años hace | 0

Respondida
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'...

más de 12 años hace | 0

Respondida
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...

más de 12 años hace | 1

| aceptada

Respondida
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; ...

más de 12 años hace | 0

| aceptada

Respondida
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>

más de 12 años hace | 0

Respondida
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...

más de 12 años hace | 0

Respondida
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 ...

más de 12 años hace | 0

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

más de 12 años hace | 0

| aceptada

Cargar más