Answered
Code for png image using sobel operator
Hi, Here is the simple solution with MATLAB's builtin function of Image Processing Toolbox that works quite well: COCA = i...

6 years ago | 0

Answered
Synchronization / division of sequenced measurement data
Hi, Just to display all (two or more different sets of data), you can augment all your measured data sets, e.g.: X_ALL = [x1...

6 years ago | 0

Answered
How to run a for loop when variables are different lengths?
Hi, Here is the solution to your exercise: delta = -23.28:0.01:23.28; phi = -90:1:90; for ii = 1:numel(delta) for jj=...

6 years ago | 0

Answered
System of first order differential equations in Simulink
There are a couple of errs made in your model with the feedback and summing junction. Here is the corrected model view. You'd n...

6 years ago | 0

Answered
Matlab to Simulink optimisation using Ga
Hi If I've understood your question correctly is that you are trying to run/simulate your pre-existing Simulink model from yo...

6 years ago | 1

| accepted

Answered
Undefined operator '-' for input arguments of type 'cell'
Hi Hazem, Just looking at your provided one command line, only intuitive concern might be with an improper call function name...

6 years ago | 0

Answered
Discrete Time Plotting in MATLAB
Hi, Use this command: stem(data_of_interest) % instead of stem(time, data_of_interest) Your used command is plotting two d...

6 years ago | 0

Answered
how to resolve the following error "Algebraic loops are not supported in generated code. Use the 'ashow' command in the Simulink Debugger to see the algebraic loops" ? R2013b
In fact, it is a problem to use algebraic loops. Thus, you'd need to remove alebraic loops by employing transfer function approa...

6 years ago | 0

Answered
How to divide each column in array 1 by corresponding column in array 2 and put answers in new array, array 3
Perform the elementwise division: Transmittance = SPFPMTSignal./SkinPMTSignal; This solves your exercise. Good luck

6 years ago | 0

| accepted

Answered
What does the equation do in the 2 images to combine it to one image
Actually this gives two images representing one image twice one of which is darker than the other. The comma "," just a separate...

6 years ago | 1

| accepted

Answered
save or write variables in function file
You can save in two different ways: Assign the output variables, e.g.: function [Out1, Out2, Out3, Outn] = MYfunction(In1, In2...

6 years ago | 0

Answered
Where is the error in my below code for approximate solution of poisson boundary value problem?
Hi, There was one technical error that there are two nested functions named with the same name, e.g. MatElt2Nd(). Here is the...

6 years ago | 0

Answered
Define variable array with if statement using exiting arrays
Hi, a small loop would solve your exercise: X1 = linspace(-5, 15)'; X2 = linspace(12, 0)'; for ii=1:numel(X1) if X1(ii)<...

6 years ago | 0

Answered
Change grid extent so title is visible
Hi, you'd need to make the following two changes in your scripts for plot figure setting adjustments. figure ax1 = axes('P...

6 years ago | 0

Answered
I want to store data in a matrix from a for loop using non integer indexing
Hi, There are several ways of doing it: Most efficient way: x = [5:0.1:20]; v = (1:.1:10)'; MAT=v.*x; 2. Least efficie...

6 years ago | 0

| accepted

Answered
Make a point move straight up and down
Hi, If I've understood your question correctly, you'd like to get a up and down motion of a point x, y(i). Then here is one o...

6 years ago | 0

Answered
Make a point move straight up and down
Hi, A simple motion or animation tool with plot tools is drawnow that can be employed in your task, e.g.: https://www.math...

6 years ago | 0

Answered
How to create a movie from different .fig files ?
Hi, One of the easy matlab fcns to build movies from plot figures is getframe() along with drawnow. See the help doc: https:...

6 years ago | 0

Answered
How can one put mean and std of the data into histogram using annotation?
Hi, A user can fully control the location of the legend by indicating its location as: legend({sprintf('mean = %3.2f, std = ...

6 years ago | 0

Answered
create a vector of 0 and 1s that takes 1 at a fixed interval
Hi, O=zeros(1, 20); m=input('m = '); IN=m+1:m+1:numel(O); O(IN)=1;

6 years ago | 0

Answered
problems using Start in Data Acquisition script
Hi Maybe you should add data rate, e.g.: D = daq("ni"); D.Rate = 5000; addinput(D, "ThunderdomeDAQ", "ai0", "Voltage"); ...

6 years ago | 0

Answered
Simulink,Increase the simulation speed
Hi You can try: a variable step solver: adjust absolute and realtive tolerances a fixed step solver: use a few different...

6 years ago | 0

Answered
ASSISTANCE ON RUNNING RANDOM VARIABLES IN A FUNCTION
Hi, Here is a nice tutorial that explains everything what you need for your exercise. https://www.mathworks.com/help/matlab/...

6 years ago | 0

Answered
How do I hanning window a signal before FFT, inside of for loop?
Hi, You can insert your anticipated hanning window command on line 81 of your script, i.e., hold on; WIN_Hann=hann(length(Di...

6 years ago | 0

Answered
how to compute the complex Fourier series expansion of half-wave rectified signal. and plot its phase and amplitude spectrum?
Hi, Here are several nice tutorial examples of matlab on Fourier Transform. https://www.mathworks.com/help/matlab/math/fouri...

6 years ago | 1

Answered
Gerchberg–Saxton algorithm/ Phase Retreiveal algorithm
Here is one of the nice scripts posted on the MathWorks website: https://www.mathworks.com/matlabcentral/fileexchange/65979-gerc...

6 years ago | 0

Answered
How to apply a random Crossover (Arithmetic/Scattered/Two-point) in Genetic Algorithm using auto-generated file from Optimization Toolbox ?
See the screen shot given in the attachement. You should select from the drop-down options whichever crossover function suits fo...

6 years ago | 0

Answered
Improving fit of custom function
Hi, Why not to use cftool (Curve Fitting Toolbox). Launch it with: >> cftool Indicate your x data and y data variable na...

6 years ago | 0

Answered
C = union( A,B ) is too slow. Is there any faster way given that A and B are ordered.
Hi, This one could be faster: ismember(A, B)

6 years ago | 0

Answered
how to transfer a 3D variable into a row in an excel file?
Hi, a simple solution might be this one: for ii=1:14 % EEGData has 14 layers SH=strcat('Sheet', num2str(ii)); xls...

6 years ago | 0

Load more