Respondida
changine if-elseif to a switch-case structure
Dear Mike, You can convert if-else code to switch case structure as follows: InputValue = input('Input value: '); val = ...

más de 12 años hace | 0

| aceptada

Respondida
How do I apply an if statement to every row of a matrix of varying number of rows?
Dear Shannon, you can put the if-else statements in a loop as follows: A=load('Dynamics.txt'); m=A(:,1); c=A(:,2); ...

más de 12 años hace | 1

Respondida
How can I make a vector from the elements in the same position across many matrices?
Dear Patrick, you can do it as follows: NumberOfMatrices = 736; A = randi(100, 72, 144, NumberOfMatrices); % Your 736 ma...

más de 12 años hace | 0

| aceptada

Respondida
How to Stretching and shrinking a graph
Beside the comment you can do something like this: scaling_factor = 2; % define the scaling factor and graph will scale acc...

más de 12 años hace | 0

Respondida
how to compare two cells and fetch the values ?
Dear Sandy, maybe you can try something like this: x= ['A','B','C','D','E','F']; y= ['B','E','F']; z = reshape(inters...

más de 12 años hace | 0

Respondida
how to do watershed segmentation?
Dear Sheno, maybe following links are helpful for you: <http://www.mathworks.com/help/images/ref/watershed.html> <http://w...

más de 12 años hace | 0

Respondida
The question is here http://i.imgur.com/EkSTC0x.png?1
Dear Leonardo, here is the code for this problem: x_deg = input('Input angle in degrees: '); x = degtorad(x_deg); sum...

más de 12 años hace | 1

| aceptada

Respondida
What does this code say? (Linear Algebra related) (Poisson)
Dear Guile, I placed references for all the things which maybe confusing for you. You can try to access those references to find...

más de 12 años hace | 0

Respondida
How to extract data from a cell in a specific way ?
Dear Stamatis, here is code for converting cell array into a matrix: for i = 1:12 data{i} = rand(1, 69); % create ce...

más de 12 años hace | 1

| aceptada

Respondida
How to ignore new values?
Dear Tristan, you can do it as follows: p1 = 5; % initialize p1 a = p1; % store p1 value in new variable to use later ...

más de 12 años hace | 0

| aceptada

Respondida
how can I plot this equation ?
Dear Ahmed, here is the code: Lgo = 1; % constant value for Lgo Lg2 = 1; % constant value for Lg2 theta = -pi:0.01:pi...

más de 12 años hace | 0

Respondida
Writing a script file for cost of a telephone call according to the following price schedule:
Dear Andrew, here is the code for your question: calltime = input('Enter call time(day, evening, night): ', 's'); calldu...

más de 12 años hace | 0

| aceptada

Respondida
Compute Fourier Series Coefficients
Dear Claire, see the following link: <http://www.mathworks.de/matlabcentral/answers/90990-how-to-calculate-fourier-coefficients-...

más de 12 años hace | 0

Respondida
Formatting code to display multiple results.
Dear David, you can output iteration number and iteration values as follows: function [xn, iterations] = Newton (f, df, xi,...

más de 12 años hace | 1

| aceptada

Respondida
how can i subplot 4 separate graphs for machine's velocity
Here is one alternate: V = 70; machine = [100 150 200 250]; t=0:0.5:10; for i = 1:numel(machine) road = V*e...

más de 12 años hace | 1

| aceptada

Respondida
if A=1:0.1:10 and B=1:4,T=exp(A/B) , is there anyway to plot a graph of T against A?
Dear Austin, you can do it as follows: A = 1:0.1:10; B = linspace(1, 4, numel(A)) T=exp(A./B); plot(A, T), xl...

más de 12 años hace | 0

Respondida
Center of mass - Going nuts!
Dear Rasmus, I run your code and got these two values: Xko = 2.000428632661809 Yko = 3.357265323617660 Ar...

más de 12 años hace | 0

Respondida
calculate the annual discharge over several years
Dear Maria, here is the code for required functionality: ID = fopen('filename.txt'); data = textscan(ID, '%f%f%f%f'); ...

más de 12 años hace | 0

Respondida
Plotting two 3D points from a textscan output
Dear Tom, you can do it as follows: ID = fopen('filename.txt', 'r'); data = textscan(ID, '%s'); fclose(ID); data =...

más de 12 años hace | 0

| aceptada

Respondida
Bar Plot of 2-D Array - How to label each individual bar with the value on top?
Dear Robert, replace first two lines of your code as follows and you will get your desired bar plot: x=[1:15]'; y=round...

más de 12 años hace | 0

Respondida
How to customize excel?
Dear Tommaso, maybe it is helpful for you: <http://www.mathworks.de/matlabcentral/answers/37284> Good luck!

más de 12 años hace | 0

Respondida
How can I draw a 3D Free Energy Diagram from a text file which has 3 columns?
Dear Ankita, you can plot 3 columns of equal length as follows: ID = fopen('filename.txt'); data = textscan(ID, '%f%f%f'...

más de 12 años hace | 0

| aceptada

Respondida
How to multiply Multidimensional Arrays with a column vector
Dear Tristan, here is the code which performs the task: A = cat(3, [2 8; 0 5], [1 3; 7 9]); B=[1 2]'; for i = 1:lengt...

más de 12 años hace | 0

Respondida
Multiplying 2 matrices, using a for loop and storing results in a table.
Dear Andres, you can do it as follows using for loop: D = [cos(pi/18) -sin(pi/18); sin(pi/18) cos(pi/18)]; X = [0.80;0];...

más de 12 años hace | 0

Respondida
Read data from file and print information for whom has the required criteria?
Dear Nora, here is the code which reads the file and then shows information for people having blood group 'AB': ID = fopen(...

más de 12 años hace | 0

| aceptada

Respondida
new to Matlab --- how do I enter a matrix summation to find the time response of vibration
Dear Todd, one way to do is as follows: syms t_sym u = [1, 0; 0, 0]; v = [0, 0; 0, 0]; Xi = [1, 0.78; 0.78, -1]; ...

más de 12 años hace | 0

Respondida
Changing names within a data
Dear Nora, here is the code which performs your desired task: ID = fopen('filename.txt'); a = textscan(ID, '%s%f'); f...

más de 12 años hace | 0

| aceptada

Respondida
plotyy two variables one with two series
Dear Abdulaziz, yes you can plot it. The following is an illustration of it: temparature = 1:100; u = rand(1, 100); v...

más de 12 años hace | 0

| aceptada

Respondida
A very basic question about nested for loops
Dear Negar, re-write the last line as follows: sigma_est{i} = cov(F); Then sigma_est will contain 9 matrices of 2x2 size...

más de 12 años hace | 0

| aceptada

Respondida
Madhava approximation of pi
Dear Kaylynn, here is the function which approximates value of pi using Madahava Sangamagrama equation: function [ output_a...

más de 12 años hace | 0

| aceptada

Cargar más