Risposto
How to find a vector multiple times in an array?
A = [1 3 4] %x,y,z-coordinates - vector B = [2 3 4; 1 3 4; 5 5 6; 3 4 6; 1 3 4]; %array find(all(A==B, 2)) % 2 is for row...

quasi 3 anni fa | 1

| accettato

Risposto
Is there any way to access a variable whose name is expressed by another string variable?
myvar = 10; string_myvar = "myvar2"; assignin('base', string_myvar, myvar); myvar2

quasi 3 anni fa | 0

Risposto
How can find column wise similarity of two matrix?
A=[3 1 1 2 1 3 3 2 1 1 2 1 3 2 3 2 ]; B=[ 2 1 3 3 1 2 3 1 1 1 1 2 2 2 3 3 ]; find(al...

quasi 3 anni fa | 0

Risposto
How to add 2 or 3 tables in column wise ?
% for array a = randn(5,1); b = randn(5,1); c = randn(5, 1); d = randn(5,1); % 5->50 x = [a; b; c; d]

quasi 3 anni fa | 0

| accettato

Risposto
Pre-allocate memory to zeros or NaN?
If you have skipped some data and want to omit those data later on, then the preallocation with nan is a better options. Especi...

quasi 3 anni fa | 0

| accettato

Risposto
How can I link a matrix to a menu selections.
kilometers = [2887 7277 11628 7171 11856 5132 4432 10360 5450 12193 2624 7366 10321 8203 13201 5344 5333 8308 7394 14816];...

quasi 3 anni fa | 0

| accettato

Risposto
Antilog formula in matlab
tmp = 1og10((W_TO-A)./B); W_E = 10.^(tmp); % check out the definition of invlog10; it should be 10^x

quasi 3 anni fa | 0

Risposto
How to correctly plot a 6x2 grids of subplots
You can use montage which remove the gaps of subplot axes. doc montage for more details. % fileNames is the string array of im...

quasi 3 anni fa | 1

Risposto
Extract magnitude response in dB using fvtool(_) or freqz(_)
fvtool visualizes filter frequency response and it has no return value. freqz returns the frequency response and has the syntax...

quasi 3 anni fa | 0

Risposto
How to turn off function signatures?
Home->Preferences->Matlab->Keyboard-> Disable the function hint (in editor and command window).

quasi 3 anni fa | 0

| accettato

Risposto
giving me error when i was usin the basic program of my course files and this is also same as the tutorial program
try give an input argument to he function: rfact(2)

quasi 3 anni fa | 0

Risposto
random select n elements from n arrays
nele = 100; nlist = 50; data = randn(nele, nlist); % data in the list idx = randi([1 nele], 1 ,nlist); % r...

quasi 3 anni fa | 0

Risposto
Sliding window with 40 window size and 25%(10) overlap on the cell array
Version 4: % Creat some data ns = randi([10,50], 30, 1); % number of samples for 30x1 cell elements x = cell(length(ns), ...

quasi 3 anni fa | 1

| accettato

Risposto
how to run .m file using uigetfile() in button callback
Try the following: run(fullfile(pathname, filename));

quasi 3 anni fa | 0

| accettato

Risposto
Error on phase diagram
x=[-1:0.05:1]; y=[-1:0.05:1]; m=length(x); n=length(y); xc=zeros(m,n); yc=zeros(m,n); for i=1:m for j=1:n xc...

quasi 3 anni fa | 1

| accettato

Risposto
How to automate dimensional expansion elegantly(broadcasting mechanism)?
meanRGB = [0.485, 0.456, 0.406]; stdRGB = [0.229, 0.224, 0.225]; oriImg = imread('peppers.png'); % RGB,[0,255] range img = re...

quasi 3 anni fa | 0

| accettato

Risposto
import over 1000 files
You may hit the limit os the number of files that can be opened simutaneously. While it possible to increase the maximum number...

quasi 3 anni fa | 0

Risposto
How to calculate a printed arithmetic
str = []; for A=1:3 if A==1 str = [str sprintf('2')]; elseif A==2 str = [str sprintf('+')]; el...

quasi 3 anni fa | 0

| accettato

Risposto
Event-based script without any infinite loop
doc timer. Here is an example to display a message every 3sec for 3 times: t = timer; t.StartDelay = 3; t.TimerFcn = @(myTim...

quasi 3 anni fa | 0

| accettato

Risposto
How to make scientific notation appear next to each tick/label on axes instead of the top?
x = linspace(1e-6, 2e-6, 21); plot(x) h = gca; h.YTickLabel = string(x*1e6)+"\times10^{-6}";

quasi 3 anni fa | 0

| accettato

Risposto
How do I cut a vector from the end of a vector of a certain length and keep it in an independent vector
A=[1 2 3 4 5 6 7 8 9] cutpoint = 7; B=A(1:cutpoint) C=A(cutpoint+1:end)

quasi 3 anni fa | 1

| accettato

Risposto
Question about exponential functions and draw plots
doc fplot for more details. a = 1; b= 2; f = @(x) exp(a*abs(x) + b); fplot(f)

circa 3 anni fa | 0

Risposto
Removing redundant rows where not every row has the same number of elements
x = ["HIST1H2BC" "K13" "HIST1H2BC" "K13;K16" "HIST1H2BC" "K16" "HIST1H2BH" "K13" "HIST1H2BH" "K13;K16" "HIST1H2BH" "K16" "...

circa 3 anni fa | 0

Risposto
Import multiple .txt files
Use "headerlines" parameter to ignore the header lines: data = textread(file_paths{i}, format, 'headerlines', headlineNum);

circa 3 anni fa | 0

Risposto
Extract the row that contains the minimum value in the last column of a matrix
A = randn(4, 5) [~, irow] = min(A(:, end)); b = A(irow, :)

circa 3 anni fa | 1

| accettato

Risposto
How to read, reshape, and write large data?
You can read a small portion each time and write to the file. This way you will not use a lot of memory. blocksize = 1e6; nfi...

circa 3 anni fa | 0

| accettato

Risposto
Average data from excel
fn = dir('10G*.xls'); nfiles = length(fn); ax(1) = subplot(121); hold on; ax(2) = subplot(122); svp = cell(size(fn)); ...

circa 3 anni fa | 1

Risposto
How to find the maximum value of the first column in multiple matrices?
X = rand([6,3,6]); % find maximum value of 1st column of each 6 matrices max(squeeze(X(:, 1, :)))

circa 3 anni fa | 1

| accettato

Risposto
Applying a Bessel Filter to Acceleration Data
Do you think you really need bessel filter (for linear group delay)? Otherwise, other filter types give better attenuation/rippl...

circa 3 anni fa | 1

| accettato

Risposto
plz help me with this task
correctpw = ["user1" "abcd12345"; "user2" "abcdefg"]; loginstatus = false; while true userna...

circa 3 anni fa | 0

Carica altro