PhD Student at UWM

Answered

Error using fprintf Invalid file identifier. Use fopen to generate a valid file identifier. Function help

Because E is a numeric variable, it conot be used directly in your case. Use E with some formatting: fprintf('%g\n',E)

Error using fprintf Invalid file identifier. Use fopen to generate a valid file identifier. Function help

Because E is a numeric variable, it conot be used directly in your case. Use E with some formatting: fprintf('%g\n',E)

1 jour ago | 0

Answered

How do I write a number and Letter in the same line?

You can use: fprintf('grade=%f, %s\n',n, grade);

How do I write a number and Letter in the same line?

You can use: fprintf('grade=%f, %s\n',n, grade);

2 jours ago | 0

| accepted

Answered

finite element method with matrix error

Can you show the values of the nodes and elements data?

finite element method with matrix error

Can you show the values of the nodes and elements data?

4 jours ago | 0

Answered

Seeking a little clarification on using sprintf with %d and formatSpec etc. to load similar *.MAT filenames that only differ in name by number.

you can use: sprintf('Band%dHz.mat', k*200);

Seeking a little clarification on using sprintf with %d and formatSpec etc. to load similar *.MAT filenames that only differ in name by number.

you can use: sprintf('Band%dHz.mat', k*200);

5 jours ago | 0

Answered

"SWITCH expression must be a scalar or a character vector".

Try to get 'Value' in the call back function: handles.patient = get(hObject,'Value');

"SWITCH expression must be a scalar or a character vector".

Try to get 'Value' in the call back function: handles.patient = get(hObject,'Value');

6 jours ago | 0

Answered

How can I make a variant submatrix?

You can use vectors to point to the indices of matrix A, For example: A(1:10, 1:10); % the first one A(11:20, 1:10) % second ...

How can I make a variant submatrix?

You can use vectors to point to the indices of matrix A, For example: A(1:10, 1:10); % the first one A(11:20, 1:10) % second ...

7 jours ago | 0

Answered

Saving Multiples Variable of a function

If you want to use the variables in the other function, use this command in both functions: global dZ3 dW3 db3 dZ2 dW2 db2 dZ1 ...

Saving Multiples Variable of a function

If you want to use the variables in the other function, use this command in both functions: global dZ3 dW3 db3 dZ2 dW2 db2 dZ1 ...

8 jours ago | 0

Answered

how do I start this?

As the quest said, you can use Matlab's spline function.

how do I start this?

As the quest said, you can use Matlab's spline function.

8 jours ago | 0

Answered

2-D Truss Analysis

One t was missing in UniVctor: %.... Input problem data nNodesP = 12; nMembersP = 21; NodeP = zeros(nNodesP, 3); %Initializ...

2-D Truss Analysis

One t was missing in UniVctor: %.... Input problem data nNodesP = 12; nMembersP = 21; NodeP = zeros(nNodesP, 3); %Initializ...

8 jours ago | 0

Answered

Bisection method help.

function x = Bisection(a, b, Nmax, TOL) f=@(x) x.*x.*x-2; i=1; ya = f(a); while i <= Nmax m=(a+b)/2; ym=f(m); ...

Bisection method help.

function x = Bisection(a, b, Nmax, TOL) f=@(x) x.*x.*x-2; i=1; ya = f(a); while i <= Nmax m=(a+b)/2; ym=f(m); ...

8 jours ago | 0

Answered

Converting for loop to while loop

for i =1:5 j=1; k=1; while j<=5-i fprintf(' '); j = j+1; end while k<=i fpri...

Converting for loop to while loop

for i =1:5 j=1; k=1; while j<=5-i fprintf(' '); j = j+1; end while k<=i fpri...

8 jours ago | 1

| accepted

Answered

How to draw a curly brace outside the gca?

Use negative ccordinates for the brace byt xlim from 0 drawbrace([-0.5,3], [-0.5,8], 10); xlim([0,Inf]);

How to draw a curly brace outside the gca?

Use negative ccordinates for the brace byt xlim from 0 drawbrace([-0.5,3], [-0.5,8], 10); xlim([0,Inf]);

9 jours ago | 0

Answered

A recursive matrix sum

You function is not recursive function total=ff(l) lp=l(:); if numel(l) == 1 total = l(1); else total = lp(end) + ...

A recursive matrix sum

You function is not recursive function total=ff(l) lp=l(:); if numel(l) == 1 total = l(1); else total = lp(end) + ...

9 jours ago | 0

| accepted

Answered

Adding a line to my plot3 of a plane

Two lines should be fixed: 1- coordinates of end points of the line 2- Using plot3 %Position vector p1 = [200; -107; 0] %%or...

Adding a line to my plot3 of a plane

Two lines should be fixed: 1- coordinates of end points of the line 2- Using plot3 %Position vector p1 = [200; -107; 0] %%or...

9 jours ago | 0

Answered

How to solve this function to find z?

Numerical (approximate) solution: syms z; p=4; vpasolve(z/(z-1)*sqrt(z/(2+z))*sqrt(p)==0.32734,z)

How to solve this function to find z?

Numerical (approximate) solution: syms z; p=4; vpasolve(z/(z-1)*sqrt(z/(2+z))*sqrt(p)==0.32734,z)

9 jours ago | 1

Answered

Index in position 2 exceeds array bounds (must not exceed 8)

The matrix is not square, so you need to find the minimum of row and column numbers. A = [28 -6 4 1 -2 -5 8 0; -4 28 -1 4 0 4 4...

Index in position 2 exceeds array bounds (must not exceed 8)

The matrix is not square, so you need to find the minimum of row and column numbers. A = [28 -6 4 1 -2 -5 8 0; -4 28 -1 4 0 4 4...

9 jours ago | 0

| accepted

Answered

Newton's Method to find root of a system of equations

For solving a system of equations, you should solve a system of equation insetead of division: % single equation xn = xn - f(x...

Newton's Method to find root of a system of equations

For solving a system of equations, you should solve a system of equation insetead of division: % single equation xn = xn - f(x...

10 jours ago | 0

Answered

Function takes as input two nonempty matrices A and B and returns the product AB

function AB = ex2(A,B) % % % we need rows and columns of both A and B % ColsA should be equal to RowsB [RowsA,ColsA] = size...

Function takes as input two nonempty matrices A and B and returns the product AB

function AB = ex2(A,B) % % % we need rows and columns of both A and B % ColsA should be equal to RowsB [RowsA,ColsA] = size...

10 jours ago | 0

| accepted

Answered

Matrix Dimensions must agree

change the varibales to vector form: A=[0.05, 0.08, 0.7, 0.01]; E=[125, 80, 100, 150]; L=[0.6, 0.7, 0.2, 0.5]; ndof=length(A...

Matrix Dimensions must agree

change the varibales to vector form: A=[0.05, 0.08, 0.7, 0.01]; E=[125, 80, 100, 150]; L=[0.6, 0.7, 0.2, 0.5]; ndof=length(A...

11 jours ago | 0

Answered

Create a circle in the matrix with zeros

% values N=100; D=ones(N,N); i0=10; j0=20; R=8; % filter indise circle [x,y]=meshgrid(1:N); D((x-i0).^2+(y-j0).^2<R^2)=0...

Create a circle in the matrix with zeros

% values N=100; D=ones(N,N); i0=10; j0=20; R=8; % filter indise circle [x,y]=meshgrid(1:N); D((x-i0).^2+(y-j0).^2<R^2)=0...

11 jours ago | 0

Answered

Simple question loop for

You can simply add a disp command to see that nothing will be printed when n=0. It means that the statements inside the loop wil...

Simple question loop for

You can simply add a disp command to see that nothing will be printed when n=0. It means that the statements inside the loop wil...

11 jours ago | 0

Answered

Compare 2 arrays using for loop and if statement

M =[1 2 3 ; 8 9 0]; e = 2; m = size(M,1); n = size(M,2); M_filter_1 = zeros(size(M)); A =[1 2 3 4 5 6 7 8 9 0]; for a = A...

Compare 2 arrays using for loop and if statement

M =[1 2 3 ; 8 9 0]; e = 2; m = size(M,1); n = size(M,2); M_filter_1 = zeros(size(M)); A =[1 2 3 4 5 6 7 8 9 0]; for a = A...

12 jours ago | 0

Answered

If statement with multiple variables, or if the variables can be shortened.

if x<1 && x<=0.75 a = x - 0.75; elseif x>=0.5 b = x - 0.5; elseif x>=2.5 c = x - 0.25; else d = x; end ...

If statement with multiple variables, or if the variables can be shortened.

if x<1 && x<=0.75 a = x - 0.75; elseif x>=0.5 b = x - 0.5; elseif x>=2.5 c = x - 0.25; else d = x; end ...

12 jours ago | 0

Answered

floating point arithmetics, mathlab's interpretation of a . after a number

Matlab sotere double numbers in 8 bytes (64 bits) . So if you do some aritmatic operations, there is an error due to the limits ...

floating point arithmetics, mathlab's interpretation of a . after a number

Matlab sotere double numbers in 8 bytes (64 bits) . So if you do some aritmatic operations, there is an error due to the limits ...

13 jours ago | 1

Answered

Plotting discrete piecewise funtion

piecewise function is for symbolic toolbox. You can use: t=0:0.1:5.0; f= t.*(t>=0 & t<1 ) + exp(-t+1).*(t>=1); plot(t,f);

Plotting discrete piecewise funtion

piecewise function is for symbolic toolbox. You can use: t=0:0.1:5.0; f= t.*(t>=0 & t<1 ) + exp(-t+1).*(t>=1); plot(t,f);

13 jours ago | 0

Answered

matlab matrix with specific elements

assume that i is from 1 to 5 and j is from 1 to 6: % i: 1 to 5 % j: 1 to 6 [i,j] = meshgrid(1:5,1:6); a=2*(j-4).*(i+1)-3...

matlab matrix with specific elements

assume that i is from 1 to 5 and j is from 1 to 6: % i: 1 to 5 % j: 1 to 6 [i,j] = meshgrid(1:5,1:6); a=2*(j-4).*(i+1)-3...

14 jours ago | 0

| accepted

Answered

How to give gap between curves? Please see the attached graph

Do you want something like this? plot (x,y,'Color',[0.4940, 0.1840, 0.5560],'LineStyle','-','LineWidth',1.5) hold on plot (x,...

How to give gap between curves? Please see the attached graph

Do you want something like this? plot (x,y,'Color',[0.4940, 0.1840, 0.5560],'LineStyle','-','LineWidth',1.5) hold on plot (x,...

14 jours ago | 0

| accepted

Answered

Highlight Region of Sine Graph

% Do you want this? x=linspace(0,2*pi,101); y=sin(x); area(x,y)

Highlight Region of Sine Graph

% Do you want this? x=linspace(0,2*pi,101); y=sin(x); area(x,y)

14 jours ago | 0

| accepted

Answered

Stitching together matrices/ indexing matrices

For each k, you should know the connectivity array, for example if the first element is connected to the following degrees of fr...

Stitching together matrices/ indexing matrices

For each k, you should know the connectivity array, for example if the first element is connected to the following degrees of fr...

14 jours ago | 1