Beantwortet
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 = ...

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 1

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 1

| akzeptiert

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 1

| akzeptiert

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

Beantwortet
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,...

mehr als 12 Jahre vor | 1

| akzeptiert

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

mehr als 12 Jahre vor | 1

| akzeptiert

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

Beantwortet
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'); ...

mehr als 12 Jahre vor | 0

Beantwortet
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 =...

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

Beantwortet
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];...

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
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]; ...

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

| akzeptiert

Mehr laden