Solved


Triangular matrices in 3D array
Given a 3D numeric array _x_, return an array _y_ of the same size in which all entries to the right of the main diagonal are ze...

6 years ago

Solved


BULLSEYE Part 2: Reference Problem 18 BULLSEYE
Given n (always odd), return output a that has concentric rings of the 1s and 0s around the center point. Examples: Input ...

6 years ago

Solved


ZigZag matrix with reflected format
ZigZag MATRIX with REFLECTED format. We have only input x. We have to create a matrix in the following pattern. input n=5...

6 years ago

Answered
Composite Trapezoid rule
Here is a simple solution to this exercise: x = -1:0.02:1; y = -1:0.025:1; [xx,yy] = meshgrid(x,y); Fun = xx.^2 -2*yy.^2+xx....

6 years ago | 0

Answered
sine wave and sampling
The solution of this exercise is relatively simple: N=40; % Size of a signal: resolution of the signal wit...

6 years ago | 0

Answered
equation of inverted pendulum model
Here is the complete documentation on Inverted Pendulum's Simulink model building and how to the model blocks are implemented: h...

6 years ago | 0

Answered
Upgraded to 2010b - can no longer specify Fixed-Step ODE4 with continuous states
In fact, in Solver selection tab, Solver Type: Fixed-Step is selected, then all of the solvers ode1 (Euler), ode2 (Heun), ode3 (...

6 years ago | 0

Answered
Getting wrong answer,
Hi, In your code, there are a few errors with loop indexes. Here is the fixed part of the script that gives all correct answe...

6 years ago | 0

| accepted

Answered
Accessing parsim Output Data
hi, You can make some changes in your shown code: Call the variable series of "in" computed within for .. end loop. Like: In1(...

6 years ago | 0

Answered
imagesc replacement so I can see individual values colorcoded
Hi, A simple way is: spy(b)

6 years ago | 0

Answered
A totally lost student :)
Hi, Here is the corrected solution to your exercise. f=@(x) (x-1)./(x.^2+x); x=[-25:0.1:-1, 0:.1:25;]; y=f(x); plot(x,y),...

6 years ago | 0

| accepted

Answered
Multidimensional Arrays Global stiff matrix
Substitute this portion of your code: LSM = zeros(2, 2, Num_elements); for x=1: Num_elements LSM(1,1)= K; LSM(1,2)= -K; LSM...

6 years ago | 0

| accepted

Answered
How to display format time in sprintf or similar?
Hi, instead of disp and sprintf, fprintf can be used more efficiently, e.g.: fprintf('Reduce temperture to 150²C and cook fo...

6 years ago | 0

Answered
Object oriented programming in Matlab
This tutorial seems to be a good guide for the start. You can check it out: https://www.cs.ubc.ca/~murphyk/Software/matlabTutori...

6 years ago | 0

Answered
How to convert C code to SImulink Model
Yes, it is feasible with some restrictions. You'd need to convert to S-functions. Here are some docs: https://in.mathworks.com...

6 years ago | 0

Answered
Multidimensional Arrays Global stiff matrix
Here is the GSM created in loops: LSM(1,1)= K; LSM(1,2)= -K; LSM(2,1)= -K; LSM(2,2)= K; GSM = zeros(Num_elements); for i...

6 years ago | 0

Answered
Trying to get taylor's series to work the old fashion way for x^2." Array indices must be positive integers or logical values"?
Hi, Here are corrected part of the code with for loop: tic %start a timer for the i loop below for i=1:length(h) % do som...

6 years ago | 1

| accepted

Answered
MATLAB workspace not showing variables but a struct called 'wng'
did you use: >> clear all? and restart your pc?

6 years ago | 0

Answered
How to retrieve outputs from an .m file into my GUI?
One of the possible solutuons is to call/excute your pre-created function file, that loads your *.txt data into MATLAB (depicted...

6 years ago | 0

Answered
Using plot3 to plot 3d vectors
This one is the correct way of plotting the data points: point1 = [4,5,6]; point2 = [-3,6,-3]; point3 = [1 2 3]; origin = [0...

6 years ago | 0

| accepted

Answered
How can I run an equation to sequentially plug in data from two matrixes of different size?
You'd need to use elementwise operation and : operator to get all calcs done. rho = [1.59e-8, 1.68e-8, 2.44e-8, 2.82e-8, 1e-7...

6 years ago | 0

Answered
setting variable to true or false
Hi, As understood your question, you'd need to write a code something similar to this one: WHAT_2_do = input('Enter 1 to ani...

6 years ago | 0

Answered
how to add gaussian noise to the signal with mean and std
Here is the short code and data generated data: clearvars Data= load('Signal.txt'); % Import of M...

6 years ago | 0

Answered
how to add gaussian noise to the signal with mean and std
% Here is the sample code Signal = Data; % Measured data available in the MATLAB workspace under var...

6 years ago | 0

Answered
does not resolve to a valid data type for parameter "OutDataTypeStr"
Hi, Probably, you'd need to put a tickmark on: [Ouput as nonvirtual bus]

6 years ago | 0

Answered
how to add gaussian noise to the signal with mean and std
Hi, Here is the documentation that gives all the hints how to generate the noise w.r.t your signal and MATLAB's built in fu...

6 years ago | 0

| accepted

Answered
How to do UItable Heading in center alignment and font Size increase
Hi, You can use the HAlign as shown here in this doc: https://www.mathworks.com/help/rptgen/ug/mlreportgen.dom.table-class.ht...

6 years ago | 0

| accepted

Answered
How to log acquired data to disk, and save the video file as mp4 or .avi ?
Hi, Probably, you'd need to indicate the directory of your log data as a whole, e.g.: '../dir/videos/MATLAB.mp4'

6 years ago | 0

Answered
Complex answer of acos function
Hi, It has been checked and your script is not giving ' complex' values for t1 or t1_Array. It is working ok. Good luck

6 years ago | 0

Answered
How to solve stream function
Hi, dsolve() can't be used here. Here is the good explantion how to solve your exercise: https://www.mathworks.com/matlabcentr...

6 years ago | 0

Load more