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

oltre 10 anni fa | 0

| accettato

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

oltre 10 anni fa | 1

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

oltre 10 anni fa | 0

| accettato

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 1

| accettato

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 1

| accettato

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

oltre 10 anni fa | 0

| accettato

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

| accettato

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 1

| accettato

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

oltre 10 anni fa | 1

| accettato

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

| accettato

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

| accettato

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

| accettato

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

quasi 11 anni fa | 0

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

quasi 11 anni fa | 0

| accettato

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

quasi 11 anni fa | 0

| accettato

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

quasi 11 anni fa | 0

| accettato

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

quasi 11 anni fa | 0

| accettato

Carica altro