Risposto
Changing names within a data
Dear Nora, you can do it the following way: ID = fopen('filename.txt'); a = textscan(ID, '%s%f%s%f'); fclose(ID); ...

quasi 11 anni fa | 0

Risposto
Using Power Iteration on a Large Matrix
Dear Alex, Of course MATLAB can handle it. The main problem comes not with MATLAB but with the processing capacity as well as me...

quasi 11 anni fa | 1

| accettato

Risposto
draw picture with ezplot
Dear xinyu, yes you can plot as follows: syms beta omega Lambda rho rho = Lambda * omega + beta; rho2 = subs(rho, [La...

quasi 11 anni fa | 0

Risposto
Matlab "too many output arguments"
Dear Gilmar, I wrote a sample function which takes 20 inputs and gives 4 outputs as below: function [w, x, y, z] = myfoo(x1...

quasi 11 anni fa | 1

Risposto
As I can solve the following problem binary
Dear FRANCISCO, here is the code which performs the desired function: s = 1:100; % Your array n = 11; % Length of sub-ar...

quasi 11 anni fa | 0

| accettato

Risposto
I take 4x4 blocks from the Gray image , filtered it and now i want to return it back to the original gray .
Dear Zgrt, you can do it the following way: gray3=dct2(gray2); gray4=gray3(1:4,1:4); IDCT_Gray=idct2(gray4); h = f...

quasi 11 anni fa | 1

| accettato

Risposto
midpoint rule for integration
Dear Joe, re-write f as follows: f = @(x) (x.^3-1).^(1/2); Then code should work. I hope it helps. Good luck!

quasi 11 anni fa | 2

Risposto
Can I create an array of matricies?
Dear James. you dont need loop for this you can do it like this: array1 = rand(10, 1); array2 = rand(10, 1) * 2; ar...

quasi 11 anni fa | 0

| accettato

Risposto
How to calculate fourier coefficients in Matlab
Dear Javid, here is the code for your problem: A = input('Enter value of A:'); B = input('Enter value of B:'); D = in...

quasi 11 anni fa | 0

| accettato

Risposto
Attempted to access dz(1,1000); index out of bounds because numel(dz)=1.
Dear Alex, here is your working code, I made some modifications(If i understood correctly what you want to do): k = 0.5; ...

quasi 11 anni fa | 0

Risposto
Problem with a program concerning composite trapezoid rule
Dear Drake, re-write first line as: f = @(x) 1./(1+x.^2); then it should work. Good luck!

quasi 11 anni fa | 0

| accettato

Risposto
How to make for loop ?
Dear Negar, try this: for j = 1:length(files) [signal,Fs,nbits,opts] = wavread(strcat('database/ae/ae_0a0', num2str(...

quasi 11 anni fa | 0

| accettato

Risposto
How can i compress this code into some form of loop so that it is not so bulky?!
Dear Joel, you can make this code compact in the following way: s = 2; syms n i = 1:4; f = n.^i; fprime = i .* ...

quasi 11 anni fa | 0

Risposto
Having trouble implementing a function
It means you should input all four values for "f,tspan,y0,N" because your "euler" function has four inputs

quasi 11 anni fa | 0

| accettato

Risposto
Is there a way to disconnect lines between data points while utilizing the plot function?
Dear Brad, you can do it the following way: x = [1;2;3;4;5;6;7;8;9]; y = [10;20;30;40;50;60;70;80;90]; plot(x(1...

quasi 11 anni fa | 0

| accettato

Risposto
Loop not working? How can i save the total values wth out getting overwrite in the save file?
Dear Uday, you don't need loop in this case. You can do what you need directly as follows: a=input ('what is the a value?')...

quasi 11 anni fa | 1

Risposto
how do I plot one channel of data when I have 100 channels?
Here is the code for this: select_channel = 10; % select channel you want to plot M = rand(100, 300); % It is matrix which...

quasi 11 anni fa | 0

Risposto
Unable to run symbolic script, MATLAB is making fractions extremely large and unable to handle them
Dear Amit, here is the modified code: tic syms x1 x2 x3 a; f = x1^2+2*x2^2+2*x3^2+2*x1*x2+2*x2*x3; p=[1,1,1]; n...

quasi 11 anni fa | 1

| accettato

Risposto
How do I plot this sine wave?
Dear Niamh, you can do the following way: time = -1:0.01:1; frequency = 97; phase = 97; phase_in_rad = degtorad(ph...

quasi 11 anni fa | 1

| accettato

Risposto
from 8760 x 1 to 1 x 8760 ??
Dear you can do like this(if i understood correctly): num = xlsread('filename.xls', 'A:A'); ind = 1:length(num); matr...

quasi 11 anni fa | 0

Risposto
store the value in the variable
you can do like this: p = C(1,:) q = C(2,:) Or if you want to use for loop then you can do like this: p = zeros(...

quasi 11 anni fa | 0

| accettato

Risposto
How do I split a color image into its 3 RGB channels?
If you want to show RGB channels in there original color then you can do like it: img = imread('filename.png'); % Read imag...

quasi 11 anni fa | 11

Risposto
Writing zero to text file
Dear Andrew, you can write the 0s in the text file in the following way: a = {'0.00000', '0.00000', '0.000000'}; ID = fo...

quasi 11 anni fa | 0

Risposto
Problem with symbolic math
Dear Amit, it is working fine: syms x1 x2 x3 gr = [2*x1 + 2*x2; 2*x1 + 4*x2 + 2*x3; 2*x2 + 4*x3]; p1 = [957/2500; -29...

quasi 11 anni fa | 0

Risposto
How to extract a part of a given vector and store it in a new vector using loops (for loop) ?
Dear Abhisek, here is the code for it: a = [1 2 3 4 5 6 7 8 9 10]; indices_of_values2save = [4 5 6 7]; count = 1; ...

quasi 11 anni fa | 0

| accettato

Risposto
How to declare function?
Dear Mustafa, function y = calculate_sqrt(x) y = x .* (sqrt(x) - sqrt(x - 1)); end you can save it with th...

quasi 11 anni fa | 0

| accettato

Risposto
Time to run programming
Yes you can use tic your code... toc See: <http://www.mathworks.de/de/help/matlab/ref/tic.html> and <http:/...

quasi 11 anni fa | 0

Risposto
r g b components of an image
Dear Shefali, one way to just show three separate color images is as follows: img = imread('filename'); figure, imshow...

quasi 11 anni fa | 5

Risposto
num2str not working for me
Dear Chris, you don't need to use num2str function in order to achieve your goal. You can solve this equation and also able to c...

quasi 11 anni fa | 0

Risposto
Write a function that produces a plot for the Cantor Set
Dear Jerry, here is the code which plotting Cantor Set: n = input('Input number of iterations:'); a = cell(1,n); for j = ...

quasi 11 anni fa | 0

| accettato

Carica altro