Answered
How can I export text and numeric data from excel to uitable (GUI element)
According to the docs, when you set the Data property of a uitable created with the figure function, you must set it to a numeri...

4 years ago | 0

Answered
cellfun vs. varfun applied to column of table
varfun passes entire variables from your table into your function. It calls your function once per table variable. The variable ...

4 years ago | 1

| accepted

Answered
rotate colorbar tick labels
You could place the labels yourself using text. Personally, I'd rather MATLAB figure out the placement. Here's code which puts ...

4 years ago | 0

Answered
transform fprintf in disp
Maybe this? disp(sprintf('\nPara i= %d\n e a= %f e a resposta é: %f ', i, n, c)) You'll get a warning that fprintf is prefe...

4 years ago | 0

Answered
Adding Legend to a multiple graph within a loop
The legend should show after you call legend(), i.e.: clear all close all clc hold on data=dlmread('data.txt') for i= 1:27...

4 years ago | 0

| accepted

Answered
assume(x^2 == y) doesn't work
From the docs, "assume is not additive. Instead, it automatically deletes all previous assumptions on the variables in conditio...

4 years ago | 0

Answered
Histogram with adjusted bins to gaussian
If you'd like to fit a histogram to a normal distribution but you don't know the underlying data (e.g. you've altered the histog...

4 years ago | 0

Answered
MATLAB drawrectangle ROI custom wait function difficulty
Store the figure in h so that when you later call close(h), MATLAB knows what h is: h = figure(1);

4 years ago | 0

| accepted

Answered
How to edit grid lines on a 3D plot
It seems to me that Dillen.A's answer from your link is pretty elegant. Adapting that code to work with 3D axes: f = figure; ...

4 years ago | 1

| accepted

Answered
Matlab Sort Command Output
How about this? x1=3; x2=1; x3=2; a=[x1 x2 x3]; varNames = {'x1','x2','x3'}; [~, idx] = sort(a); fprintf('Output:\n%s\n',...

4 years ago | 1

Answered
Compare elements from two matrix.
How about this? x = x1; idx = abs(x1) < abs(x2); x(idx) = x2(idx);

4 years ago | 0

| accepted

Answered
Subscript indices must either be real positive integers or logicals.
thetat=0:0.012566:0.6283; for idx = 1:numel(thetat) % use thetat(idx) to access the appropriate theta value in any iterati...

4 years ago | 0

| accepted

Answered
Value assignment to vector, without loop
Here's an option: N = 20; idx = (1:N)'; out = (idx >= frm & idx <= to)*value'; The indices in frm and to can't overlap, and ...

4 years ago | 1

| accepted

Answered
How do you display a users input into an questdlg command?
fprintf prints text to a file which corresponds to the supplied file ID or, if you don't supply a file ID, the command window (f...

4 years ago | 0

| accepted

Answered
How can i prevent the plots from appearing while still using them as frames for the movie function?
Plot your frames on a figure whose Visible property is set to 'off': fig = figure('Visible', 'off'); ax = axes(fig); x = lins...

4 years ago | 0

Answered
Vectors must be the same length with plot of Shear Force Diagram
If you look in the workspace, you should see that X has length 200 while V has length 101. If you want to plot V over X, they ne...

4 years ago | 0

| accepted

Answered
subplot question - with image and plot
This is possible by setting the parent axes in your call to imshow: subplot(1,2,1); plot(rand(10,1)); ax = subplot(1,2,2); i...

4 years ago | 0

Answered
Matlab 3 variable function plot
You can pick any interval. Your plot will only show something if solutions to f=0 lie within the interval. [0, 0, -b1/Beta(3)] i...

4 years ago | 1

Answered
Error using plot !
z has length (44100 1/s) * (5 s) = 220500. t has length 220501. You could use linspace to ensure t has the correct length: t = ...

4 years ago | 0

Answered
Display data in matrix with two different colour scales, depending on cell value
This first bit of code sets up a colormap with 2*N colors ranging from dark green to light green to light red to dark red: N = ...

4 years ago | 0

| accepted

Answered
Change color to grey
colormap([0.86 0.86 0.86]) freqz2(abs(h,[32 32]));

4 years ago | 0

| accepted

Answered
To get 100 vectors using the previous vector
Better to not name the arrays Q1, Q2, Q3... Q = cell(100,1); Q{1} = Q1; for i = 2:numel(Q) Q{i} = F*Q{i-1}; end

4 years ago | 0

| accepted

Answered
Haunted Code (Serious)
That is the default image upside down. You can view it by calling just >> image When you call imshow(image); MATLAB first ev...

4 years ago | 2

| accepted

Answered
How can i plot surfaces for a recursive function?
Try this: for n = 0:5 ax = subplot(2,3,n+1); fsurf(ax, @(x,y) F(n,x,y), [-1 1]) end

4 years ago | 0

| accepted

Answered
Why does the signature of my method change at runtime?
You can either reference your function with @(block, event) app.updateSpeed(block) or @(block, event) updateSpeed(app, block)...

4 years ago | 0

| accepted

Answered
Matrix Indexig or how to access values of a matrix
You could convert to linear indices: solution = A(sub2ind(size(A),index(:,1),index(:,2)));

4 years ago | 0

| accepted

Answered
split a 2d matrix and create new 3d matrix from the results of the 2d matrix
I believe this should do what you want: Matrix_T_A = permute(repmat(T_A, 1, 1, 24), [3 2 1]); Using the for loop, T_A(i,:).*...

4 years ago | 0

| accepted

Answered
Plot surface from a stored handle (handle of a surface) in .mat file
How about this? set(sobf, 'Parent', gca) If you want to save the view, gridlines, ticks, anything else about the axes rather t...

4 years ago | 0

| accepted

Answered
Plot matrix values as colors in a checkerboard pattern
Why red? What if some real data is mapped to red? You are right about the -1 values messing things up. But the 0s on the border...

4 years ago | 0

| accepted

Answered
Problems with xaxis ticks and labels
The x axis limits are from 1 to 34, based on your box plot. When you call hold on and then plot a line from 0 to 35, the limits ...

4 years ago | 0

| accepted

Load more