Answered
How do i fill this cilinder matrix with ones
I'd use some simple code like this to create a 3D array with a cylinder filled by ones: x = -maxx:maxx; y = (-maxy...

8 years ago | 0

Answered
Parent and child gui not working
Opening the fig file is not sufficient, because it does not start the code to manage the figure, e.g. the OpeningFcn. Open the s...

8 years ago | 0

| accepted

Answered
How to set a time windows vector
This seems to by a job for the <https://www.mathworks.com/help/matlab/ref/datetick.html datetick> (link) command.

8 years ago | 0

Answered
How to resolve interp1 error?
% Failing: t_opt = linspace(0,4452*0.001,4452)'; x1_opt = -(pi/Tf)*t + pi; xinit = interp1(t_opt, x1_opt, t); ...

8 years ago | 0

Answered
how can i save a state name by name input from user
function saveState(hObject, EventData, handles) global destX; global destY; global strtX; global strtY; global ...

8 years ago | 0

Answered
Mouse click on Axes Problem
It is prone to bugs to rely on the current axes object by |cla| and |gca|. You have the handle of the axes available, so use it....

8 years ago | 1

| accepted

Answered
Hi, how can you make a cancel button functionable on a waitbar when loading a file in R2007b?
h = waitbar(0, 'Data File is Loading...', ... 'CreateCancelBtn', '1', 'setappdata(h,''loading'',0)', handles.pushbutt...

8 years ago | 0

Answered
cancelling waitbar insdie a gui function
You cannot access the handle |pvh| from the callback, when it is defined as a string. Callbacks defines as a string are evaluate...

8 years ago | 0

| accepted

Answered
I am getting Unbalanced or unexpected parenthesis or bracket?
This is no valid Matlab syntax: plot(V_PV, I_PV, 'b' (0 Vmp Voc), (Isc Imp 0), 'ro') % ^^^^^^^^^^^ ^...

8 years ago | 0

| accepted

Answered
I want to read all these images into my workspace. Path of all the images are in this csv file. i imported it into a table. how to read these images now. please do help.
See * <https://www.mathworks.com/matlabcentral/answers/57446-faq-how-can-i-process-a-sequence-of-files FAQ: How to process a...

8 years ago | 0

Answered
unusual subscriptied assignment mismatch
You get a warning in each iteration: Warning: Integer operands are required for colon operator when used as index va...

8 years ago | 0

| accepted

Answered
Delay when resizing a figure in R2016b
Sigh. The next Windows Update has overwritten the Intel driver. Now even a re-installation does not help. The issue does not app...

8 years ago | 0

Answered
How to vectorize three for loop or fast
* Avoid repeated calculations. * Process the data in column order. Ur = zeros(291,243,1459); [NR, NC]=size(lat); for...

8 years ago | 0

| accepted

Answered
Operations between every 2 different elements in a cell?
Maybe you mean: index = nchoosek(1:4, 2); for k = 1:size(index, 1) operation(ur{index(k, 1), 3}, ur{index(k, 1), 3}...

8 years ago | 0

| accepted

Answered
How I can check the system solution with a Matlab ODE function.
function main t0 = 0; y0= [50,0,600,1] [t,y] = ode45(@fcn, [t0, 7], y0); plot(t, y); end function dydt = f...

8 years ago | 0

| accepted

Answered
My GUI contains many items ,how to resize it bigger than screen size to contain all these items in one GUI and browsing over GUI by scroll ?
See: * <https://www.mathworks.com/matlabcentral/fileexchange/5253-scrolling-figure-demo> * <https://www.mathworks.com/matlab...

8 years ago | 0

Answered
Matlab Function: Solving Ax=B using Gaussian Elimination where b is a n x m matrix not necessarily a n x 1 matrix.
[row,col] = size(A); n = row; x = zeros(size(b)); for k = 1:n-1 for i = k+1:n xMultiplier = A(i,k) / ...

8 years ago | 3

Answered
how to crop image with specific row & columns
img = imread('plot intensity.JPG'); cropped = img(460, 150:250, :)

8 years ago | 0

Answered
How to add value of same variable in mat-file within function in GUI
function editProc_Callback(hObject, eventdata, handles) Trab2=str2num(get(hObject, 'String')); set(hObject,'string',num2...

8 years ago | 0

| accepted

Answered
Unable to locate required installation files
The first download of Matlab does not contain all toolboxes. To reduce the download size, the toolboxes are downloaded after you...

8 years ago | 0

Answered
How do I delete the zeros from the matrix?
You can pre-allocate the output the avoid the time-consuming iterative growing. This simplifies the code: s1 = size(A, 1); ...

8 years ago | 0

Answered
Why slider is not working in my GUI?
You are creating a new slider inside the callback of the slider: handles.SliderFrame = uicontrol('Style','slider','Position...

8 years ago | 0

| accepted

Answered
How do I delete the zeros from the matrix?
Your data is a numerical matrix - the upper left 5x5 submatrix is: 6.5600 0 0 0 0 ...

8 years ago | 0

Answered
Is interpolation between matrices of different sizes possible?
[Sorry, this is not a solution, but thought as answers.] This is not a problem of Matlab, but a mathematical question. It is ...

8 years ago | 1

Answered
Load .mat files from subfolders with different names
You can get the list of names of the subfolders easily: Base = 'C:\Temp'; % adjust to your needs List = dir(fullfile(Base, '*...

8 years ago | 5

| accepted

Answered
Using xlsread to select non-consecutive rows from excel spreadsheet?
If you want to apply a condition to the values inside Matlab, you have to import all data at first, check the condition and sele...

8 years ago | 0

| accepted

Answered
Calling ode45 with cellfun ignores TSPAN
I observe the same problem in R2009a. Which Matlab release are you using? When |ode45| is called with one output argument only, ...

8 years ago | 1

| accepted

Answered
How to print cell contents into m-file?
inputs = {'x' 'y' 'z' 'k'}; signs = '**/'; Result = inputs{1}; for k = 1:numel(signs) Result = [Result, signs(...

8 years ago | 0

Answered
Using the outerjoin to join more than 2 tables
You can nest the joining: outerjoin(A, outerjoin(B, C)) [EDITED] With a loop: function Joined = MultiOuterJoin(va...

8 years ago | 0

Answered
Save plot to image variable
img = rand(100, 100, 3); p1 = [30, 20]; % Start point p2 = [90, 40]; % End point nPoint = max(abs(p1 - p...

8 years ago | 0

| accepted

Load more