Réponse apportée
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 = ...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
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); ...

plus de 12 ans il y a | 1

Réponse apportée
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...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 0

Réponse apportée
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...

plus de 12 ans il y a | 0

Réponse apportée
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...

plus de 12 ans il y a | 0

Réponse apportée
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...

plus de 12 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 0

Réponse apportée
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...

plus de 12 ans il y a | 1

| A accepté

Réponse apportée
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 ...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 0

Réponse apportée
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...

plus de 12 ans il y a | 0

| A accepté

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

plus de 12 ans il y a | 0

Réponse apportée
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,...

plus de 12 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 0

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

plus de 12 ans il y a | 0

Réponse apportée
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'); ...

plus de 12 ans il y a | 0

Réponse apportée
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 =...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 0

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

plus de 12 ans il y a | 0

Réponse apportée
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'...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 0

Réponse apportée
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];...

plus de 12 ans il y a | 0

Réponse apportée
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(...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
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]; ...

plus de 12 ans il y a | 0

Réponse apportée
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...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
Madhava approximation of pi
Dear Kaylynn, here is the function which approximates value of pi using Madahava Sangamagrama equation: function [ output_a...

plus de 12 ans il y a | 0

| A accepté

Charger plus